async public void Test1() { await AggregateClass.AggregateAsync(); string expected = @"../../../../AggregateGDPPopulation.Tests/expected-output.json"; string output = @"../../../../AggregateGDPPopulation/output/output.json"; //string actualOutput = streamReader1.ReadToEnd(); //string expectedOutput = streamReader2.ReadToEnd(); //Assert.Equal(actualOutput, expectedOutput); Task <string> task1Actual = ReadWrite.ReadDataAsync(expected); string task1Data = await task1Actual; Task <string> actualOutput = ReadWrite.ReadDataAsync(output); string task2Data = await actualOutput; Assert.Equal(task1Data, task2Data); }
public static void BasicIteratorTest() { var aggregate = new AggregateClass(); // Add Books to aggregate collection. aggregate.Add(new Book("The Hobbit", "J.R.R. Tolkien", 304)); aggregate.Add(new Book("The Name of the Wind", "Patrick Rothfuss", 662)); aggregate.Add(new Book("To Kill a Mockingbird", "Harper Lee", 281)); aggregate.Add(new Book("1984", "George Orwell", 328)); aggregate.Add(new Book("Jane Eyre", "Charlotte Brontë", 507)); // Get new Iterator from aggregate. var iterator = aggregate.CreateIterator(); // Loop while Next() element exists. while (iterator.Next()) { // Output current object. Console.WriteLine(iterator.Current); } }
public IteratorClass(AggregateClass aggregate) { _aggregate = aggregate; }