public void When_LeagueNameIsEmpty_Then_ValidationError() { var command = new UpdateTeamLeagueMatchLineupEntryCommand { LeagueName = "" }; var validator = new UpdateTeamLeagueMatchLineupEntryCommandValidator(); validator.ShouldHaveValidationErrorFor(x => x.LeagueName, command); }
public void When_MatchGuidIsEmpty_Then_ValidationError() { var command = new UpdateTeamLeagueMatchLineupEntryCommand { LeagueName = "Premier League", MatchGuid = Guid.Empty }; var validator = new UpdateTeamLeagueMatchLineupEntryCommandValidator(); validator.ShouldHaveValidationErrorFor(x => x.MatchGuid, command); }
public void When_LineupEntryGuidIsEmpty_Then_ValidationError() { var command = new UpdateTeamLeagueMatchLineupEntryCommand { LeagueName = "Premier League", MatchGuid = Guid.NewGuid(), TeamName = "Tottenham Hotspur", LineupEntryGuid = Guid.Empty }; var validator = new UpdateTeamLeagueMatchLineupEntryCommandValidator(); validator.ShouldHaveValidationErrorFor(x => x.LineupEntryGuid, command); }
public void When_CommandIsOk_Then_NoValidationErrors() { var command = new UpdateTeamLeagueMatchLineupEntryCommand { LeagueName = "Premier League", MatchGuid = Guid.NewGuid(), TeamName = "Tottenham Hotspur", LineupEntryGuid = Guid.NewGuid(), PlayerNumber = "1", PlayerName = "John Doe" }; var validator = new UpdateTeamLeagueMatchLineupEntryCommandValidator(); validator.ShouldNotHaveValidationErrorFor(x => x.LeagueName, command); validator.ShouldNotHaveValidationErrorFor(x => x.MatchGuid, command); validator.ShouldNotHaveValidationErrorFor(x => x.TeamName, command); validator.ShouldNotHaveValidationErrorFor(x => x.LineupEntryGuid, command); validator.ShouldNotHaveValidationErrorFor(x => x.PlayerNumber, command); validator.ShouldNotHaveValidationErrorFor(x => x.PlayerName, command); }