public void LoanItem_ShouldBeAbleToPersistAndRecall() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- using (var ctx = new WimsDbContext(_tempDb.CreateConnection())) Clear(ctx); EntityPersistenceTester.CreateFor <LoanItem>() .WithContext <WimsDbContext>() .WithSharedDatabase(_tempDb) .WithEntityFrameworkLogger(Console.WriteLine) .WithDbMigrator(conn => new MigrationsRunner(conn)) .ShouldPersistAndRecall(); //---------------Test Result ----------------------- }
private static void AddItem(WimsDbContext dbContext, LoanItem loanItem) { dbContext.LoanItems.Add(loanItem); dbContext.SaveChanges(); }