public void GetAllBlogs_GetAllListsWithItems_Should_Return_Enumerable_TodoLists() { var listData = new List<TodoList> { new TodoList { Name = "BBB", Id = 1 }, new TodoList { Name = "ZZZ", Id = 2 }, new TodoList { Name = "AAA", Id = 3 }, }; var listItemData = new List<TodoListItem> { new TodoListItem { Id = 1, Name = "testItem", Content = "test content"} }; var connection = Effort.DbConnectionFactory.CreateTransient(); using (var ctx = new MiniArchDatabaseContext(connection)) { ctx.TodoLists.AddRange(listData); ctx.TodoListItems.AddRange(listItemData); ctx.SaveChanges(); var service = new ListService(ctx); var todoLists = new List<TodoListModel>(service.GetAllListsWithItems()); Assert.AreEqual(3, todoLists.Count); Assert.AreEqual("BBB", todoLists[0].Name); Assert.AreEqual("ZZZ", todoLists[1].Name); Assert.AreEqual("AAA", todoLists[2].Name); } }