offline-twitter/persistence/follows_test.go
2022-01-04 14:40:51 -05:00

24 lines
365 B
Go

package persistence_test
import (
"testing"
. "offline_twitter/persistence"
)
func TestIsFollowing(t *testing.T) {
p := Profile{}
p.UsersList = []Follow{
Follow{Handle: "guy1"},
Follow{Handle: "guy2"},
}
if p.IsFollowing("guy3") {
t.Errorf("Should not be following guy3")
}
if !p.IsFollowing("guy2") {
t.Errorf("Should be following guy2")
}
}