Esempio n. 1
0
        public void GivenFootballDetails_WhenGetTeamNames_ThenReturnsListOfUniqueTeamNames()
        {
            //arrange
            var footballDetails = new List <FootballDetail>()
            {
                new FootballDetail()
                {
                    home    = "Man U",
                    visitor = "Chelsea"
                },
                new FootballDetail()
                {
                    home    = "Man City",
                    visitor = "Liverpool"
                },
                new FootballDetail()
                {
                    home    = "Man City",
                    visitor = "Everton"
                }
            };

            //act
            var result = _footballService.GetTeamNames(footballDetails);

            //assert
            Assert.IsType <List <string> >(result);
            Assert.Equal(5, result.Count);
        }
Esempio n. 2
0
        public IActionResult GetTeamNames()
        {
            var result = _footballService.GetTeamNames(_footballDetails);

            return(Content(JsonConvert.SerializeObject(result)));
        }