diff --git a/tests/connstr_test.go b/tests/connstr_test.go index 95a0d0080..8ef89b7bc 100644 --- a/tests/connstr_test.go +++ b/tests/connstr_test.go @@ -138,18 +138,35 @@ func TestFromString(t *testing.T) { for _, tt := range cases { t.Run(tt.name, func(t *testing.T) { - servicer, err := services.NewServicerFromString(tt.connStr) - service, ok := servicer.(*Service) + t.Run("NewServicerFromString", func(t *testing.T) { + servicer, err := services.NewServicerFromString(tt.connStr) + service, ok := servicer.(*Service) - if tt.err == nil { - assert.Nil(t, err) - assert.True(t, ok) - } else { - assert.True(t, errors.Is(err, tt.err)) - return - } + if tt.err == nil { + assert.Nil(t, err) + assert.True(t, ok) + } else { + assert.True(t, errors.Is(err, tt.err)) + return + } + + assert.Equal(t, service.Pairs, tt.pairs) + }) + t.Run("NewStoragerFromString", func(t *testing.T) { + storager, err := services.NewStoragerFromString(tt.connStr) + storage, ok := storager.(*Storage) + + if tt.err == nil { + assert.Nil(t, err) + assert.True(t, ok) + } else { + assert.True(t, errors.Is(err, tt.err)) + return + } + + assert.Equal(t, storage.Pairs, tt.pairs) + }) - assert.Equal(t, service.Pairs, tt.pairs) }) } } diff --git a/tests/storage.go b/tests/storage.go index 3fc65cc31..97e6272fa 100644 --- a/tests/storage.go +++ b/tests/storage.go @@ -13,6 +13,8 @@ type Storage struct { objects []*Object + Pairs []Pair + UnimplementedCopier UnimplementedFetcher UnimplementedMover diff --git a/tests/utils.go b/tests/utils.go index 0639b7c78..58aa5579d 100644 --- a/tests/utils.go +++ b/tests/utils.go @@ -23,5 +23,5 @@ func NewServicer(pairs ...typ.Pair) (typ.Servicer, error) { } func NewStorager(pairs ...typ.Pair) (typ.Storager, error) { - return &Storage{}, nil + return &Storage{Pairs: pairs}, nil }