예제 #1
0
        public void NhlService_GetNhlTeamsAsync_CallsRepo()
        {
            // Arrange
            _nhlRepository.Setup(r => r.GetNhlTeamsAsync()).ReturnsAsync(new List <DataContracts.NHLTeamContract>());

            // Act
            var result = _nhlService.GetNhlTeamsAsync();

            // Assert
            _nhlRepository.Verify(s => s.GetNhlTeamsAsync(), Times.Once());
        }
예제 #2
0
        public async Task <IHttpActionResult> GetNhlTeams()
        {
            var teams = await _nhlService.GetNhlTeamsAsync();

            if (teams == null)
            {
                return(NotFound());
            }

            return(Ok(teams));
        }