public void DeleteKundeTest()
 {
     TestEnvironmentHelper.InitializeTestData();
     AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
     int count = autoReservation.GetKunden().Count;
     Kunde delete = autoReservation.GetKunden()[0];
     int id = delete.Id;
     autoReservation.DeleteKunde(delete);
     Assert.AreEqual(count - 1, autoReservation.GetKunden().Count);
     Assert.IsNull(autoReservation.GetKunde(id));
 }
 public void GetKundeByIdTest()
 {
     TestEnvironmentHelper.InitializeTestData();
     AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
     IList<Kunde> kunden = autoReservation.GetKunden();
     Kunde first = kunden[0];
     int id = first.Id;
     Kunde kundeById = autoReservation.GetKunde(id);
     Assert.AreEqual(first, kundeById);
 }
 public void KundeTest()
 {
     TestEnvironmentHelper.InitializeTestData();
     AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
     IList<Kunde> kunden = autoReservation.GetKunden();
     Assert.AreEqual(4, kunden.Count);
 }
        public void UpdateKundeTest()
        {
            string modifiedVorname = "Test Vorname";

            TestEnvironmentHelper.InitializeTestData();
            AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
            IList<Kunde> kunden = autoReservation.GetKunden();
            Kunde modified = kunden[0];
            Kunde original = Kunde.CreateKunde(modified.Id, modified.Nachname, modified.Vorname, modified.Geburtsdatum);

            modified.Vorname = modifiedVorname;
            int idFromUpdatedKunde = modified.Id;
            autoReservation.UpdateKunde(modified, original);
            Kunde modifiedFetchedFromDb = autoReservation.GetKunde(idFromUpdatedKunde);
            Assert.AreEqual(modified.Vorname, modifiedFetchedFromDb.Vorname);
        }
 public void InsertKundeTest()
 {
     TestEnvironmentHelper.InitializeTestData();
     AutoReservationBusinessComponent autoReservation = new AutoReservationBusinessComponent();
     int count = autoReservation.GetKunden().Count;
     Kunde kunde = new Kunde();
     int id = 99999;
     kunde.Id = id;
     kunde.Nachname = "Nachname";
     kunde.Vorname = "Vorname";
     kunde.Geburtsdatum = System.DateTime.Today;
     autoReservation.InsertKunde(kunde);
     Assert.AreEqual(count + 1, autoReservation.GetKunden().Count);
 }