forked from mtusi2026/mtusi2026lab6
feat: add bounded observability and verified SLO incident alerts
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package production
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab6/internal/cursor"
|
||||
)
|
||||
|
||||
// TestService_New rejects each missing dependency separately.
|
||||
func TestService_New(t *testing.T) {
|
||||
t.Run("Negative: missing store", func(t *testing.T) {
|
||||
// Arrange.
|
||||
codec, err := cursor.New()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Act.
|
||||
svc, err := New(nil, codec)
|
||||
|
||||
// Assert.
|
||||
if err == nil || svc != nil {
|
||||
t.Fatalf("service=%v, error=%v", svc, err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Negative: missing codec", func(t *testing.T) {
|
||||
// Arrange.
|
||||
repo := newStoreStub(t)
|
||||
|
||||
// Act.
|
||||
svc, err := New(repo, nil)
|
||||
|
||||
// Assert.
|
||||
if err == nil || svc != nil {
|
||||
t.Fatalf("service=%v, error=%v", svc, err)
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user