public void GetAllMembersSynchronouslyFromDbResultsMatchWithTestData() { // Arrange DataLayer dataLayer = new DataLayer(); List<GangMember> actualMembers; List<GangMember> expectedMembers = new List<GangMember>(); expectedMembers.Add(new GangMember { MemberID = 1, MemberName = "Gentleman Jack", MemberRank = "Bootlegger" }); expectedMembers.Add(new GangMember { MemberID = 2, MemberName = "Brainy Somerville", MemberRank = "Head Honcho" }); expectedMembers.Add(new GangMember { MemberID = 3, MemberName = "Bobby Tweaks", MemberRank = "Pickpocket" }); expectedMembers.Add(new GangMember { MemberID = 4, MemberName = "Toothless Jim", MemberRank = "Brawler" }); expectedMembers.Add(new GangMember { MemberID = 5, MemberName = "Whispering Sam", MemberRank = "Hitman" }); // Act actualMembers = dataLayer.GetAllGangMembers(); // Assert int incrementMember = 0; foreach (var gangMember in expectedMembers) { Assert.AreEqual(gangMember.MemberID, actualMembers[incrementMember].MemberID); Assert.AreEqual(gangMember.MemberName, actualMembers[incrementMember].MemberName); Assert.AreEqual(gangMember.MemberRank, actualMembers[incrementMember].MemberRank); incrementMember++; } }