public void Test_UpdateAuto()
 {
     AutoReservationBusinessComponent arvc = new AutoReservationBusinessComponent();
     Auto original = arvc.GetAllAutos()[0];
     Auto modified = arvc.GetAllAutos()[0];
     modified.Marke = "Skoda";
     arvc.UpdateAuto(original, modified);
     Auto newCar = arvc.GetAllAutos()[0];
     Assert.AreEqual("Skoda", newCar.Marke);
 }
 public void UpdateAutoTest()
 {
     TestEnvironmentHelper.InitializeTestData();
     AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
     IList<Auto> autos = autoReservation.Autos;
     Auto original = autos[0];
     Auto modified = autos[0];
     modified.Marke = "Test Marke";
     autoReservation.UpdateAuto(modified, original);
     Auto modifiedAgain = autos[0];
     Assert.AreEqual(modified, modifiedAgain);
 }
        public void UpdateAutoTest()
        {
            string modifiedBrand = "Test Marke";
            TestEnvironmentHelper.InitializeTestData();
            AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
            IList<Auto> autos = autoReservation.GetAutos();
            var standartAuto = from a in autos
                               where a.Marke == "Fiat Punto"
                               select a;

            Auto fiat = standartAuto.FirstOrDefault();
            Auto original = StandardAuto.CreateStandardAuto(fiat.Id, fiat.Marke, fiat.Tagestarif);

            Auto modified = autos[0];
            int modifiedAutoId = modified.Id;
            modified.Marke = modifiedBrand;
            autoReservation.UpdateAuto(modified, original);

            Auto fetchedFromDb = autoReservation.GetAuto(modifiedAutoId);
            Assert.AreEqual(modified.Marke, fetchedFromDb.Marke);
        }