Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle https://xorm.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
625B

  1. // Copyright 2018 The Xorm Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package xorm
  5. import (
  6. "testing"
  7. "github.com/stretchr/testify/assert"
  8. )
  9. type MCC struct {
  10. ID int64 `xorm:"pk 'id'"`
  11. Code string `xorm:"'code'"`
  12. Description string `xorm:"'description'"`
  13. }
  14. func (mcc *MCC) TableName() string {
  15. return "mcc"
  16. }
  17. func TestTableName1(t *testing.T) {
  18. assert.NoError(t, prepareEngine())
  19. assert.EqualValues(t, "mcc", testEngine.TableName(new(MCC)))
  20. assert.EqualValues(t, "mcc", testEngine.TableName("mcc"))
  21. }