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); }
public async Task <IHttpActionResult> GetAllNhlGames() { var games = await _nhlService.GetNhlGamesAsync(); if (games == null) { return(NotFound()); } return(Ok(games)); }