public async void VerifyExpectedAndActualOutput() { Task <string> expectedOutputTask = AggregateGDPPopulation.ReadFileAsync(@"../../../../AggregateGDPPopulation.Tests/expected-output.json"); Task <string> actualOutputTask = AggregateGDPPopulation.ReadFileAsync(@"../../../../AggregateGDPPopulation/output/output.json"); string expectedOutput = await expectedOutputTask; string actualOutput = await expectedOutputTask; Assert.Equal(expectedOutput, actualOutput); }
async public void Test1() { await AggregateGDPPopulation.calAggregate(); Fileoperation fileobj1 = new Fileoperation(); var actualoutput = fileobj1.reader("../../../../AggregateGDPPopulation/output/output.json"); var expectedoutput = fileobj1.reader("../../../expected-output.json"); string str1 = await actualoutput; string str2 = await expectedoutput; Assert.Equal(str1, str2); }
public async Task Test1Async() { AggregateGDPPopulation AGP = new AggregateGDPPopulation(); await AGP.performAggregateOperation(); Task <string> actualstring = IOOperations.ReadFileToEndAsync("../../../../AggregateGDPPopulation/output/output.json"); Task <string> expectedstring = IOOperations.ReadFileToEndAsync("../../../expected-output.json"); string actual = await actualstring; string expected = await expectedstring; JObject ExpectedJO = JSONOperations.JSONDeserialize(actual); JObject ActualJO = JSONOperations.JSONDeserialize(expected); Assert.Equal(ExpectedJO, ActualJO); }