public void GListEngine_GetUserLists() { //Arrange: Seeds the Mocked Accessor's list of GLists and creates an expected list of GLists SeedGListsWithAccountId(); var expected = new List <GList> { new GList { Id = 1, ListName = "Joe's First List", AccountId = 3 }, new GList { Id = 3, ListName = "Another Joe List", AccountId = 3 } }; //Act: Calls the GListEngine GetUserLists() method to return the GLists for the User with id = 3 var result = gListEngine.GetUserLists(3).ToList(); //Assert: Checks whether the expected and result list contain the same elements; only the GLists with AccountId = 3 Assert.IsFalse(expected.Count < result.Count, $"The result list contains {result.Count} GLists, but should only contain {expected.Count} GLists."); Assert.IsFalse(expected.Count > result.Count, $"The result list contains only {result.Count} GLists, but should contain {expected.Count} GLists."); CollectionAssert.AreEquivalent(expected, result, "The expected and result list have (an) unequal GList(s)."); }
public IEnumerable <GList> GetUserGLists(string id) { var parsedId = int.Parse(id); return(_gListEngine.GetUserLists(parsedId)); }