public async Task Should_GetRecentActivityAsync_ForValidInput() { //arrange int leagueId = 555555; int year = 2018; IHttpProvider httpProvider = A.Fake <IHttpProvider>(); IUrlConfigurationProvider urlConfigurationProvider = A.Fake <IUrlConfigurationProvider>(); INflPlayerService nflPlayerService = A.Fake <INflPlayerService>(); IFantasyFootballService fantasyFootballService = new EspnApiFantasyFootballService(httpProvider, urlConfigurationProvider); //act RecentActivity recentActivity = await fantasyFootballService.GetRecentActivity(leagueId, year); //assert A.CallTo(() => urlConfigurationProvider.GetRecentActivityEndpoint(leagueId, year)).MustHaveHappened(); A.CallTo(() => httpProvider.GetAsync <RecentActivity>(null)).WithAnyArguments().MustHaveHappened(); }
/// <summary> /// Client constructor method /// </summary> public EspnFantasyFootballClient() { _fantasyFootballService = new EspnApiFantasyFootballService( new SystemDotNetHttpProvider(new JsonSerializationProvider()), new HardcodedUrlConfigurationProvider()); _nflPlayerService = new NflPlayerService(new HtmlParser(), new EspnHtmlTrimService(), new HardcodedUrlConfigurationProvider()); }