1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
package integration
import (
"context"
"testing"
)
func TestProfileLogins_List(t *testing.T) {
client, teardown := createTestClient(t, "fixtures/TestProfileLogins_List")
defer teardown()
logins, err := client.ListProfileLogins(context.Background(), nil)
if err != nil {
t.Errorf("Error getting Profile Logins, expected struct, got error %v", err)
}
if len(logins) < 1 {
t.Errorf("Expected to see at least one Profile Login")
}
login := logins[0]
response, err := client.GetProfileLogin(context.Background(), login.ID)
if err != nil {
t.Errorf("Failed to get one Profile Login: %v", err)
}
if response.Username != login.Username {
t.Fatal("Recieved Profile Login Username does not match source")
}
}
|