public async Task When_Getting_A_Conduit_By_Id_Then_Successful_Result_With_Expected_Content_Is_Returned() { ICovenantApi client = ClientFactory.BuildClient(); RequestResult <Conduit> result = await client.GetConduitAsync(17, "static-us"); await result.Should().BeSuccessfulRequest() .BeEquivalentToBlizzardResponseAsync("https://us.api.blizzard.com/data/wow/covenant/conduit/17?namespace=static-us&locale=en_US"); }
public async Task When_Getting_Soulbinds_Index_Then_Successful_Result_With_Expected_Content_Is_Returned() { ICovenantApi client = ClientFactory.BuildClient(); RequestResult <SoulbindsIndex> result = await client.GetSoulbindsIndexAsync("static-us"); await result.Should().BeSuccessfulRequest() .BeEquivalentToBlizzardResponseAsync("https://us.api.blizzard.com/data/wow/covenant/soulbind/index?namespace=static-us&locale=en_US"); }
private async Task ThenClientReturnsSuccessfulResultWithExpectedContent <T>( string expectedRequestUri, string expectedContent, Func <ICovenantApi, Task <RequestResult <T> > > clientMethodUnderTest) { ICovenantApi client = ClientFactory.BuildMockClient( expectedRequestUri, expectedContent ); RequestResult <T> result = await clientMethodUnderTest(client); result.Should().BeSuccessfulRequest() .BeEquivalentToJson(expectedContent); }