public void UserEngine_GetUserEmail() { //Arrange: Seed the Mocked Accessor with a list of Users and creates a list of emails to use as arguments in GetUserEmail() SeedUsers(); List <string> emails = new List <string> { "*****@*****.**", "*****@*****.**", "*****@*****.**" }; //Act: Retrieves each User in the list of Users using their email as an argument in the UserEngine GetUserEmail() method List <User> results = new List <User>(); for (int i = 0; i < emails.Count; i++) { var user = userEngine.GetUserEmail(emails.ElementAt(i)); results.Add(user); } //Assert: Checks whether the Users were retrieved correctly by asserting that they are equal to the Users in the list of Users for (int i = 0; i < mockedUserAccessor.GetState().Count; i++) { var user = mockedUserAccessor.GetState().ElementAt(i); Assert.AreEqual(user, results.ElementAt(i), $"User {i} was retrieved incorrectly."); } }