public void When_LeagueNameIsEmpty_Then_ValidationError()
        {
            var command = new UpdateTeamLeagueMatchSubstitutionCommand
            {
                LeagueName = ""
            };

            var validator = new UpdateTeamLeagueMatchSubstitutionCommandValidator();

            validator.ShouldHaveValidationErrorFor(x => x.LeagueName, command);
        }
        public void When_MatchGuidIsEmpty_Then_ValidationError()
        {
            var command = new UpdateTeamLeagueMatchSubstitutionCommand
            {
                LeagueName = "Premier League",
                MatchGuid  = Guid.Empty
            };

            var validator = new UpdateTeamLeagueMatchSubstitutionCommandValidator();

            validator.ShouldHaveValidationErrorFor(x => x.MatchGuid, command);
        }
        public void When_SubstitutionGuidIsEmpty_Then_ValidationError()
        {
            var command = new UpdateTeamLeagueMatchSubstitutionCommand
            {
                LeagueName       = "Premier League",
                MatchGuid        = Guid.NewGuid(),
                TeamName         = "Tottenham Hotspur",
                SubstitutionGuid = Guid.Empty
            };

            var validator = new UpdateTeamLeagueMatchSubstitutionCommandValidator();

            validator.ShouldHaveValidationErrorFor(x => x.SubstitutionGuid, command);
        }
        public void When_PlayerInIsEmpty_Then_ValidationError()
        {
            var command = new UpdateTeamLeagueMatchSubstitutionCommand
            {
                LeagueName       = "Premier League",
                MatchGuid        = Guid.NewGuid(),
                TeamName         = "Tottenham Hotspur",
                SubstitutionGuid = Guid.NewGuid(),
                Minute           = "1",
                PlayerOut        = "John Doe",
                PlayerIn         = ""
            };

            var validator = new UpdateTeamLeagueMatchSubstitutionCommandValidator();

            validator.ShouldHaveValidationErrorFor(x => x.PlayerIn, command);
        }
        public void When_CommandIsOk_Then_NoValidationErrors()
        {
            var command = new UpdateTeamLeagueMatchSubstitutionCommand
            {
                LeagueName       = "Premier League",
                MatchGuid        = Guid.NewGuid(),
                TeamName         = "Tottenham Hotspur",
                SubstitutionGuid = Guid.NewGuid(),
                Minute           = "1",
                PlayerOut        = "John Doe",
                PlayerIn         = "Jane Doe"
            };

            var validator = new UpdateTeamLeagueMatchSubstitutionCommandValidator();

            validator.ShouldNotHaveValidationErrorFor(x => x.LeagueName, command);
            validator.ShouldNotHaveValidationErrorFor(x => x.MatchGuid, command);
            validator.ShouldNotHaveValidationErrorFor(x => x.TeamName, command);
            validator.ShouldNotHaveValidationErrorFor(x => x.SubstitutionGuid, command);
            validator.ShouldNotHaveValidationErrorFor(x => x.Minute, command);
            validator.ShouldNotHaveValidationErrorFor(x => x.PlayerOut, command);
            validator.ShouldNotHaveValidationErrorFor(x => x.PlayerIn, command);
        }