Exemplo n.º 1
0
 public void UpdateKundeTestWithOptimisticConcurrency()
 {
     TestEnvironmentHelper.InitializeTestData();
     AutoReservationService service = new AutoReservationService();
     KundeDto originalKunde = service.Kunden[0];
     KundeDto modifiedKunde = (KundeDto)originalKunde.Clone();
     KundeDto modifiedKunde2 = (KundeDto)originalKunde.Clone();
     modifiedKunde.Nachname = "Neuer Nachname";
     modifiedKunde2.Nachname = "Neuer Nachname2";
     service.UpdateKunde(modifiedKunde, originalKunde);
     try
     {
         service.UpdateKunde(modifiedKunde2, originalKunde);
         Assert.Fail();
     }
     catch (LocalOptimisticConcurrencyException<Kunde> ex)
     {
         Assert.IsNotNull(ex);
     }
 }
Exemplo n.º 2
0
 public void UpdateKundeTest()
 {
     TestEnvironmentHelper.InitializeTestData();
     AutoReservationService service = new AutoReservationService();
     KundeDto originalKunde = service.Kunden[0];
     KundeDto modifiedKunde = (KundeDto)originalKunde.Clone();
     modifiedKunde.Nachname = "Neuer Nachname";
     service.UpdateKunde(modifiedKunde, originalKunde);
     Assert.AreEqual(service.Kunden[0], modifiedKunde);
 }