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

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

            // Assert
            _nhlRepository.Verify(r => r.GetNhlGamesAsync(), Times.Once);
        }
예제 #2
0
        public async Task <IHttpActionResult> GetAllNhlGames()
        {
            var games = await _nhlService.GetNhlGamesAsync();

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

            return(Ok(games));
        }