public void GetAllEntitiesInvalidTypeTest() { var mockInitialiter = new Mock <IDatabaseInitializer>(); mockInitialiter.Setup(x => x.InitializeTasks()).Returns(new List <Task>()); mockInitialiter.Setup(x => x.InitializeUsers()).Returns(new List <User>()); var context = new InMemoryDataContext(mockInitialiter.Object); context.GetAllEntities <string>(); }
public void GetAllEntitiesTest() { var userList = new List <User> { new User { Id = Guid.NewGuid() }, new User { Id = Guid.NewGuid() } }; var mockInitialiter = new Mock <IDatabaseInitializer>(); mockInitialiter.Setup(x => x.InitializeTasks()).Returns(new List <Task>()); mockInitialiter.Setup(x => x.InitializeUsers()).Returns(userList); var context = new InMemoryDataContext(mockInitialiter.Object); var result = context.GetAllEntities <User>(); Assert.AreEqual(2, result.Count()); }