public void SetUp() { var context = new TestAuctioneerDbContext(Effort.DbConnectionFactory.CreateTransient()); AddTestData(context); mQueryable = context.Auctions; }
public void SetUp() { var context = new TestAuctioneerDbContext(Effort.DbConnectionFactory.CreateTransient()); AddTestData(context); mTestedService = new CategoryService(context); }
public void SetUp() { CreateDatabaseWithTestData(); var context = new TestAuctioneerDbContext(mDatabaseConnection); mUserNotifierMock = A.Fake<IUserNotifier>(); mTestedService = new UserService(context, mUserNotifierMock); }
private User ReadUserFromDatabase(string userId) { // New context is required because if SaveChanges() fails, the changes are not saved to the database // but in memory version of the entity is still in invalid state, changes to it are not rollback. var newContext = new TestAuctioneerDbContext(mDatabaseConnection); return new UserService(newContext, A.Fake<IUserNotifier>()).FindById(userId); }