Skip to content
Snippets Groups Projects
Commit 00154b49 authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

Added test coverage to search

parent 12b28244
No related branches found
No related tags found
No related merge requests found
......@@ -32,5 +32,36 @@ func TestSearchHappyPath(t *testing.T) {
}
ReceiveMessage(msg)
}
}
// Test invalid search type
func TestSearch_Invalid_Type(t *testing.T) {
fingerprint := "8oKh7TYG4KxQcBAymoXPBHSD/uga9pX3Mn/jKhvcD8M="
msgs := []string{
"SEARCH INVALID test",
"GETKEY " + fingerprint,
}
for i := range msgs {
msg, err := NewMessage(msgs[i])
if err != nil {
t.Errorf("Error generating message: %v", err)
}
ReceiveMessage(msg)
}
}
// Test invalid user
func TestSearch_Invalid_User(t *testing.T) {
msgs := []string{
"SEARCH EMAIL cat@privategrity.com",
}
for i := range msgs {
msg, err := NewMessage(msgs[i])
if err != nil {
t.Errorf("Error generating message: %v", err)
}
ReceiveMessage(msg)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment