예제 #1
0
 public void InsertFailsWithNoForeignKeyTest()
 {
     var rsvp = new Rsvp();
     rsvp.Email = "test";
     var ctx = new NerdDinners(new SQLiteConnection(_db));
     ctx.Rsvps.Add(rsvp);
     ctx.SaveChanges();
     Assert.Fail();
 }
예제 #2
0
 public void UpdateFailsWithBadForeignKeyTest()
 {
     var rsvp = new Rsvp();
     rsvp.Email = "test";
     var ctx = new NerdDinners(new SQLiteConnection(_db));
     var dinner = new Dinner { Address = "test1", EventDate = DateTime.Today, Title = "John's dinner", Identifier = Guid.NewGuid(), DoubleValue = 1.1 };
     rsvp.Dinner = dinner;
     ctx.Dinners.Add(dinner);
     ctx.Rsvps.Add(rsvp);
     ctx.SaveChanges();
     rsvp.DinnerId = 19099;
     ctx.SaveChanges();
     Assert.Fail();
 }