示例#1
0
        public void Given_MatchEntryDoesNotExistForTeam_When_GetGoalsForTeam_Then_NullIsReturned()
        {
            //Act
            var teamLiverpool = new Team {
                Name = "Liverpool"
            };
            var match = new TeamLeagueMatch();

            //Assert
            match.GetGoalsFor(teamLiverpool).Should().Be(0);
        }
示例#2
0
        public void Given_ScoreForAwayTeamIsSet_When_GetGoalsForAwayTeam_Then_GoalsForAwayTeamAreReturned()
        {
            //Act
            var teamLiverpool = new Team {
                Name = "Liverpool"
            };
            var teamChelsea = new Team {
                Name = "Chelsea"
            };

            var match = new TeamLeagueMatch
            {
                MatchEntries = new List <TeamMatchEntry>
                {
                    new TeamMatchEntry
                    {
                        HomeAway = HomeAway.Home,
                        Team     = teamLiverpool,
                        Score    = new IntegerScore {
                            Value = 2
                        }
                    },
                    new TeamMatchEntry
                    {
                        HomeAway = HomeAway.Away,
                        Team     = teamChelsea,
                        Score    = new IntegerScore {
                            Value = 1
                        }
                    }
                }
            };

            //Assert
            match.GetGoalsFor(teamChelsea).Should().Be(1);
        }