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);
		}
Beispiel #3
0
		public void SetUp()
		{
			CreateDatabaseWithTestData();

			var context       = new TestAuctioneerDbContext(mDatabaseConnection);
			mUserNotifierMock = A.Fake<IUserNotifier>();

			mTestedService = new UserService(context, mUserNotifierMock);
		}
Beispiel #4
0
		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);
		}