public virtual void Initialize() { _testDatabaseStrategy = new SqlCeDatabaseStrategy(); using (var tempContext = _testDatabaseStrategy.CreateContext()) { TestData.Add2TodoListsAnd3TodoItems(tempContext); tempContext.SaveChanges(); } // initialise the repository we are testing var context = _testDatabaseStrategy.CreateContext(); _uow = new UnitOfWork(context); }
public void SetupTest() { // create the test strategy. This will initialise a new database _testDatabaseStrategy = CreateTestStrategy(); // add test data to the database instance using (_context = _testDatabaseStrategy.CreateContext()) { ProductsTestData.AddMembers(_context); _context.SaveChanges(); } // initialise the repository we are testing _context = _testDatabaseStrategy.CreateContext(); _requestCommentRepository = new RequestCommentRepository(_context); }