Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> GetAllNhlGames()
        {
            var games = await _nhlService.GetNhlGamesAsync();

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

            return(Ok(games));
        }