本文整理汇总了Golang中github.com/corestoreio/csfw/store.TableStoreSlice类的典型用法代码示例。如果您正苦于以下问题:Golang TableStoreSlice类的具体用法?Golang TableStoreSlice怎么用?Golang TableStoreSlice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TableStoreSlice类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestTableStoreSliceIDs
func TestTableStoreSliceIDs(t *testing.T) {
ids := testStores.IDs()
assert.NotNil(t, ids)
assert.Equal(t, utils.Int64Slice{0, 5, 1, 4, 2, 6, 3}, ids)
var ts = store.TableStoreSlice{}
assert.Nil(t, ts.IDs())
}
示例2: TestTableStoreSliceCodes
func TestTableStoreSliceCodes(t *testing.T) {
codes := testStores.Codes()
assert.NotNil(t, codes)
assert.Equal(t, utils.StringSlice{"admin", "au", "de", "uk", "at", "nz", "ch"}, codes)
var ts = store.TableStoreSlice{}
assert.Nil(t, ts.Codes())
}
示例3: TestTableStoreSliceIDs
func TestTableStoreSliceIDs(t *testing.T) {
t.Skip(TODO_Better_Test_Data)
ids := testStores.Extract().StoreID()
assert.NotNil(t, ids)
assert.Equal(t, utils.Int64Slice{0, 5, 1, 4, 2, 6, 3}, ids)
var ts = store.TableStoreSlice{}
assert.Nil(t, ts.Extract().StoreID())
}
示例4: TestTableStoreSliceCodes
func TestTableStoreSliceCodes(t *testing.T) {
t.Skip(TODO_Better_Test_Data)
codes := testStores.Extract().Code()
assert.NotNil(t, codes)
assert.Equal(t, utils.StringSlice{"admin", "au", "de", "uk", "at", "nz", "ch"}, codes)
var ts = store.TableStoreSlice{}
assert.Nil(t, ts.Extract().Code())
}
示例5: TestTableStoreSliceFilterByWebsiteID
func TestTableStoreSliceFilterByWebsiteID(t *testing.T) {
gStores := testStores.FilterByWebsiteID(0)
assert.NotNil(t, gStores)
assert.Len(t, gStores, 1)
gStores2 := testStores.FilterByWebsiteID(32)
assert.Nil(t, gStores2)
assert.Len(t, gStores2, 0)
var ts = store.TableStoreSlice{}
assert.Nil(t, ts.FilterByGroupID(2))
}
示例6: TestTableStoreSliceLoad
func TestTableStoreSliceLoad(t *testing.T) {
db := csdb.MustConnectTest()
defer db.Close()
dbrSess := dbr.NewConnection(db, nil).NewSession(nil)
var stores store.TableStoreSlice
stores.Load(dbrSess)
assert.True(t, stores.Len() > 2)
for _, s := range stores {
assert.True(t, len(s.Code.String) > 1)
}
}
示例7: TestTableStoreSliceLoad
func TestTableStoreSliceLoad(t *testing.T) {
dbc := csdb.MustConnectTest()
defer dbc.Close()
dbrSess := dbc.NewSession()
var stores store.TableStoreSlice
stores.SQLSelect(dbrSess)
assert.True(t, stores.Len() >= 2) // @todo proper test data in database
for _, s := range stores {
assert.True(t, len(s.Code.String) > 1)
}
}
示例8: TestTableStoreSliceLoad
func TestTableStoreSliceLoad(t *testing.T) {
defer debugLogBuf.Reset()
dbc := csdb.MustConnectTest()
defer func() { assert.NoError(t, dbc.Close()) }()
dbrSess := dbc.NewSession()
var stores store.TableStoreSlice
_, err := stores.SQLSelect(dbrSess)
assert.NoError(t, err)
assert.True(t, stores.Len() >= 2) // @todo proper test data in database
for _, s := range stores {
assert.True(t, len(s.Code.String) > 1)
}
}