public void GListEngine_GetAllLists() { //Arrange: Seeds the Mocked Accessor's list of GLists and creates an expected list of GLists SeedGLists(); var expected = new List <GList> { new GList { Id = 1, ListName = "Sunday Groceries" }, new GList { Id = 2, ListName = "Wednesday Groceries" }, new GList { Id = 3, ListName = "MyList" } }; //Act: Calls the GListEngine GetAllLists() method to return all GLists var result = gListEngine.GetAllLists(); //Assert: Checks whether each GList in the expected and result lists are equal for (int i = 0; i < expected.Count; i++) { Assert.AreEqual(expected.ElementAt(i), result.ElementAt(i), $"The GList at index {i} was retrieved incorrectly."); } }
public IEnumerable <GList> GetAllLists() { return(_gListEngine.GetAllLists().ToArray()); }