Improved tests
This commit is contained in:
parent
ef00ca9698
commit
9b956ac441
@ -11,19 +11,7 @@ type User struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func TestGet(t *testing.T) {
|
||||
users, err := ocean.New[User]("test")
|
||||
assert.Nil(t, err)
|
||||
defer users.Clear()
|
||||
|
||||
users.Set("1", &User{Name: "User 1"})
|
||||
user, err := users.Get("1")
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, user)
|
||||
}
|
||||
|
||||
func TestCollectionAll(t *testing.T) {
|
||||
func TestAll(t *testing.T) {
|
||||
users, err := ocean.New[User]("test")
|
||||
assert.Nil(t, err)
|
||||
defer users.Clear()
|
||||
@ -39,6 +27,18 @@ func TestCollectionAll(t *testing.T) {
|
||||
assert.Equal(t, count, 2)
|
||||
}
|
||||
|
||||
func TestGet(t *testing.T) {
|
||||
users, err := ocean.New[User]("test")
|
||||
assert.Nil(t, err)
|
||||
defer users.Clear()
|
||||
|
||||
users.Set("1", &User{Name: "User 1"})
|
||||
user, err := users.Get("1")
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, user)
|
||||
}
|
||||
|
||||
func TestInteraction(t *testing.T) {
|
||||
users, err := ocean.New[User]("test")
|
||||
assert.Nil(t, err)
|
||||
|
Loading…
Reference in New Issue
Block a user