private void GivenUnishopDbContext() { var fakeSet = new FakeUserDbSet(); fakeSet.AddRange(new[] { new user { }, new user { }, new user { } }); var mock = new Mock <IUnishopEntities>(); mock.As <IDisposable>().Setup(x => x.Dispose()); mock.Setup(x => x.users).Returns(fakeSet); mock.Setup(x => x.SetModified(It.IsAny <object>())); this.unishopDbContext = mock.Object; }
private void GivenUnishopDbContext() { var fakeSet = new FakeUnicornDbSet(); fakeSet.AddRange(new[] { new inventory { unicorn_id = Guid.NewGuid() }, new inventory { unicorn_id = Guid.NewGuid() } }); this.mockedUnicornEntities = new Mock <IUnishopEntities>(); this.mockedUnicornEntities.As <IDisposable>().Setup(x => x.Dispose()); this.mockedUnicornEntities.Setup(x => x.inventories).Returns(fakeSet); this.mockedUnicornEntities.Setup(x => x.SetModified(It.IsAny <object>())); this.unishopDbContext = this.mockedUnicornEntities.Object; }
public BasketController(IUnishopEntities databaseContext) { this.unishopEntitiesContext = databaseContext; }
public BasketController() { this.unishopEntitiesContext = new UnishopEntities(); }
public UserController() { this.unishopEntitiesContext = new UnishopEntities(); }
public UnicornController(IUnishopEntities databaseContext) { this.unishopEntitiesContext = databaseContext; }