Esempio n. 1
0
 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 -----------------------
 }
Esempio n. 2
0
 private static void AddItem(WimsDbContext dbContext, LoanItem loanItem)
 {
     dbContext.LoanItems.Add(loanItem);
     dbContext.SaveChanges();
 }