Skip to content

Commit

Permalink
User: add unit test for GetFullName
Browse files Browse the repository at this point in the history
  • Loading branch information
TerraTalpi committed Aug 30, 2021
1 parent 405ecf0 commit d6600ba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions User_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,11 @@ func TestUser_UpdateUser(t *testing.T) {
t.Errorf("Could not User.DeleteUser() (for %v) after User.UpdateUser tests: %v", testuser, err)
}
}

func TestUser_GetFullName(t *testing.T) {
testuser := User{GivenName: "Bob", Surname: "Rabbit"}
wanted := fmt.Sprintf("%v %v", testuser.GivenName, testuser.Surname)
if testuser.GetFullName() != wanted {
t.Errorf("user.GetFullName() should return \"%v\", but returns: \"%v\"", wanted, testuser.GetShortName())
}
}

0 comments on commit d6600ba

Please sign in to comment.