Private
Public Access
1
0

conversation: adds Equal()

This commit is contained in:
2023-07-19 10:56:49 -06:00
parent ac27ac2d14
commit 7611bedef7
2 changed files with 40 additions and 21 deletions

View File

@@ -84,26 +84,9 @@ func TestConversations(t *testing.T) {
t.Fatalf("Unexpected number of conversations: %d (expected %d)", len(convos), 1)
}
if convos[0].Guid != conversation.Guid {
t.Fatalf("Unexpected conversation GUID: %s (expected %s)", convos[0].Guid, conversation.Guid)
}
if convos[0].LastMessagePreview != conversation.LastMessagePreview {
t.Fatalf("Unexpected conversation LastMessagePreview: %s (expected %s)", convos[0].LastMessagePreview, conversation.LastMessagePreview)
}
if convos[0].UnreadCount != conversation.UnreadCount {
t.Fatalf("Unexpected conversation UnreadCount: %d (expected %d)", convos[0].UnreadCount, conversation.UnreadCount)
}
for i, p := range convos[0].Participants {
if p != conversation.Participants[i] {
t.Fatalf("Unexpected conversation Participants: %s (expected %s)", p, conversation.Participants[i])
}
}
if !convos[0].Date.Equal(conversation.Date) {
t.Fatalf("Unexpected conversation Date: %s (expected %s)", convos[0].Date, conversation.Date)
testConversation := &convos[0]
if testConversation.Equal(&conversation) != true {
t.Fatalf("Unexpected conversation: %v (expected %v)", convos[0], conversation)
}
}