Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Ensure we do have an error before testing it #4301

Merged
merged 1 commit into from
Nov 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1943,11 +1943,13 @@ func TestProperties_ValidateZones(t *testing.T) {
ExcludeMasterFromStandardLB: helpers.PointerToBool(test.excludeMasterFromStandardLB),
}

err := p.Validate(false)

expectedMsg := test.expectedErr
if err.Error() != expectedMsg {
t.Errorf("expected error with message : %s, but got : %s", expectedMsg, err.Error())
if err := p.Validate(false); err != nil {
expectedMsg := test.expectedErr
if err.Error() != expectedMsg {
t.Errorf("expected error with message : %s, but got : %s", expectedMsg, err.Error())
}
} else {
t.Errorf("error should have occurred")
}
})
}
Expand Down