public void GetAll_WhenValid_ShouldReturnBugsCollection() { FakeRepository <Bug> fakeRepo = new FakeRepository <Bug>(); var bugs = new List <Bug>() { new Bug() { Id = 1, Text = "TEST NEW BUG 1", LogDate = new DateTime(2009, 11, 13), Status = Status.Assigned }, new Bug() { Id = 23, Text = "TEST NEW BUG 2", LogDate = new DateTime(2010, 1, 25), Status = Status.Pending }, new Bug() { Id = 21, Text = "TEST NEW BUG 3", LogDate = new DateTime(2012, 5, 5), Status = Status.Pending } }; fakeRepo.Entities = bugs; var controller = new BugsController(fakeRepo as IRepository <Bug>); fakeRepo.All(); var result = controller.GetAll().ToList <ResponseBugModel>(); var expected = bugs.AsQueryable().ProjectTo <ResponseBugModel>().ToList <ResponseBugModel>(); //// To work override Equals on Response Model! CollectionAssert.AreEqual(expected, result); }