public async void GDPPopulationbyContinentTest() { string expectedOutputPath = @"../../../../AggregateGDPPopulation.Tests/expected-output.json"; string outputPath = @"../../../../AggregateGDPPopulation.Tests/output.json"; string expectedResult = await FileOperations.ReadfileAsync(expectedOutputPath); string output = await FileOperations.ReadfileAsync(outputPath); await GDPAggregate.Main(); Assert.True(GDPAggregateTest.AggregatedGDP(expectedResult, output)); //AggregatedGDP function is used to match the values of expected output and original output and returns boolean value if test fails or passes. }
public void Test1() { GDPAggregate.OperationsMethod(); var expected = File.ReadAllText(@"../../../expected-output.json"); var actual = File.ReadAllText(@"../../../../AggregateGDPPopulation/data/output.json"); JObject actualJson = JObject.Parse(actual); JObject expectedJson = JObject.Parse(expected); Console.WriteLine(actual); Console.WriteLine("------"); Console.WriteLine(expected); Assert.Equal(expectedJson, actualJson); }