Skip to content

Commit

Permalink
User: add 2x unit test for notGraphCilentSourced
Browse files Browse the repository at this point in the history
  • Loading branch information
TerraTalpi committed Aug 30, 2021
1 parent 80c7018 commit 405ecf0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions User_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ func TestUser_ListCalendars(t *testing.T) {
if skipCalendarTests {
t.Skip("Skipping due to missing 'MSGraphExistingCalendarsOfUser' value")
}
// testing for ErrNotGraphClientSourced
notGraphClientSourcedUser := User{ID: "none"}
_, err := notGraphClientSourcedUser.ListCalendars()
if err != ErrNotGraphClientSourced {
t.Errorf("Expected error \"ErrNotGraphClientSourced\", but got: %v", err)
}
// continue with normal tests
userToTest := GetTestUser(t)

var wantedCalendars []Calendar
Expand Down Expand Up @@ -160,6 +167,14 @@ func TestUser_String(t *testing.T) {
}

func TestUser_UpdateUser(t *testing.T) {
// testing for ErrNotGraphClientSourced
notGraphClientSourcedUser := User{ID: "none"}
err := notGraphClientSourcedUser.UpdateUser(User{})
if err != ErrNotGraphClientSourced {
t.Errorf("Expected error \"ErrNotGraphClientSourced\", but got: %v", err)
}

// continue with normal tests
testuser := createUnitTestUser(t)

targetedCompanyName := "go-msgraph unit test suite UpdateUser" + randomString(25)
Expand Down

0 comments on commit 405ecf0

Please sign in to comment.