-
Notifications
You must be signed in to change notification settings - Fork 104
/
collection_test.go
38 lines (29 loc) · 1016 Bytes
/
collection_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package gocb
func (suite *UnitTestSuite) TestCollectionName() {
bName := "bucket"
sName := "scope"
cName := "collection"
b := suite.bucket(bName, suite.defaultTimeoutConfig(), nil)
s := b.Scope(sName)
c := s.Collection(cName)
suite.Assert().Equal(bName, c.bucketName())
suite.Assert().Equal(sName, c.ScopeName())
suite.Assert().Equal(cName, c.Name())
}
func (suite *UnitTestSuite) TestDefaultScopeCollectionName() {
bName := "bucket"
cName := "collection"
b := suite.bucket(bName, suite.defaultTimeoutConfig(), nil)
c := b.Collection(cName)
suite.Assert().Equal(bName, c.bucketName())
suite.Assert().Equal("_default", c.ScopeName())
suite.Assert().Equal(cName, c.Name())
}
func (suite *UnitTestSuite) TestDefaultScopeDefaultCollectionName() {
bName := "bucket"
b := suite.bucket(bName, suite.defaultTimeoutConfig(), nil)
c := b.DefaultCollection()
suite.Assert().Equal(bName, c.bucketName())
suite.Assert().Equal("_default", c.ScopeName())
suite.Assert().Equal("_default", c.Name())
}