summaryrefslogtreecommitdiff
path: root/service/container_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-29 23:20:31 +0300
committerWolfy-J <[email protected]>2018-09-29 23:20:31 +0300
commit1cfb3a4d142db6afec2befe82bdfdf625cc0f2d4 (patch)
treecb26d7ad8dce8c590a8068947e6b9509a4fab7a9 /service/container_test.go
parentc3ca96f4c9057755de78f0484dd3cad35f32c34f (diff)
less verbosity
Diffstat (limited to 'service/container_test.go')
-rw-r--r--service/container_test.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/service/container_test.go b/service/container_test.go
index c43b7ddb..7d83ee9a 100644
--- a/service/container_test.go
+++ b/service/container_test.go
@@ -117,7 +117,7 @@ func TestContainer_Register(t *testing.T) {
c := NewContainer(logger)
c.Register("test", &testService{})
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
}
func TestContainer_Has(t *testing.T) {
@@ -127,7 +127,7 @@ func TestContainer_Has(t *testing.T) {
c := NewContainer(logger)
c.Register("test", &testService{})
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.True(t, c.Has("test"))
assert.False(t, c.Has("another"))
@@ -139,7 +139,7 @@ func TestContainer_Get(t *testing.T) {
c := NewContainer(logger)
c.Register("test", &testService{})
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
s, st := c.Get("test")
assert.IsType(t, &testService{}, s)
@@ -156,7 +156,7 @@ func TestContainer_Stop_NotStarted(t *testing.T) {
c := NewContainer(logger)
c.Register("test", &testService{})
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
c.Stop()
}
@@ -169,7 +169,7 @@ func TestContainer_Configure(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{"test":"something"}`}))
@@ -186,7 +186,7 @@ func TestContainer_Init_Default(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{}`}))
@@ -205,7 +205,7 @@ func TestContainer_Init_Default_Overwrite(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{"test":{"value": "something"}}`}))
@@ -224,10 +224,10 @@ func TestContainer_ConfigureNull(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{"another":"something"}`}))
- assert.Equal(t, 2, len(hook.Entries))
+ assert.Equal(t, 1, len(hook.Entries))
s, st := c.Get("test")
assert.IsType(t, &testService{}, s)
@@ -242,10 +242,10 @@ func TestContainer_ConfigureDisabled(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{"test":"something"}`}))
- assert.Equal(t, 2, len(hook.Entries))
+ assert.Equal(t, 1, len(hook.Entries))
s, st := c.Get("test")
assert.IsType(t, &testService{}, s)
@@ -263,7 +263,7 @@ func TestContainer_ConfigureError(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
err := c.Init(&testCfg{`{"test":"something"}`})
assert.Error(t, err)
@@ -283,7 +283,7 @@ func TestContainer_ConfigureTwice(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{"test":"something"}`}))
assert.Error(t, c.Init(&testCfg{`{"test":"something"}`}))
@@ -297,7 +297,7 @@ func TestContainer_ServeEmptyContainer(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Serve())
c.Stop()
@@ -314,7 +314,7 @@ func TestContainer_Serve(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{"test":"something"}`}))
go func() {
@@ -346,7 +346,7 @@ func TestContainer_ServeError(t *testing.T) {
c := NewContainer(logger)
c.Register("test", svc)
- assert.Equal(t, 1, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{"test":"something"}`}))
err := c.Serve()
@@ -378,7 +378,7 @@ func TestContainer_ServeErrorMultiple(t *testing.T) {
c := NewContainer(logger)
c.Register("test2", svc2)
c.Register("test", svc)
- assert.Equal(t, 2, len(hook.Entries))
+ assert.Equal(t, 0, len(hook.Entries))
assert.NoError(t, c.Init(&testCfg{`{"test":"something", "test2":"something-else"}`}))
err := c.Serve()