package secretstore import "testing" func TestCredentialValidateRequiresAllFields(t *testing.T) { tests := []struct { name string cred Credential }{ { name: "missing host", cred: Credential{Username: "alice", Password: "secret"}, }, { name: "missing username", cred: Credential{Host: "imap.example.com", Password: "secret"}, }, { name: "missing password", cred: Credential{Host: "imap.example.com", Username: "alice"}, }, { name: "whitespace only fields", cred: Credential{Host: " \t ", Username: "\n", Password: " "}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if err := tt.cred.Validate(); err == nil { t.Fatal("expected validation error when a required field is missing") } }) } }