public void GetMatchDetails_FailedFetch() { _httpClientMock.Setup(s => s.SendRequest(It.IsAny <string>())).Returns(MatchDetailsServiceMockData.FailedMatch); IMatchDetailsService service = new MatchDetailsService(_httpClientMock.Object, MockApiKey); MatchDetailsResult result = service.GetMatchDetails(MockMatchId).Result; Assert.IsNotNull(result); Assert.IsNotNull(result.ErrorMessage); }
public void GetMatchDetails_NewMatch() { _httpClientMock.Setup(s => s.SendRequest(It.IsAny <string>())).Returns(MatchDetailsServiceMockData.NewMatch); IMatchDetailsService service = new MatchDetailsService(_httpClientMock.Object, MockApiKey); MatchDetailsResult result = service.GetMatchDetails(MockMatchId).Result; Assert.AreEqual(result.MatchDuration, 2151); Assert.IsFalse(result.RadiantWin); Assert.IsNull(result.ErrorMessage); }