public void InsertAutoTest()
        {
            AutoManager autoManager = new AutoManager();
            Auto        auto        = new MittelklasseAuto {
                Marke = "Opel Corsa", Tagestarif = 100
            };
            Auto insertedAuto = autoManager.Insert(auto);

            Assert.AreEqual(4, insertedAuto.Id);
            Auto getAuto = autoManager.Auto(4);

            Assert.AreEqual("Opel Corsa", getAuto.Marke);
        }
        private void ChangeAutoType(AutoKlasse autoType)
        {
            switch (autoType)
            {
            case AutoKlasse.Luxusklasse:
                Auto = new LuxusklasseAuto();
                break;

            case AutoKlasse.Mittelklasse:
                Auto = new MittelklasseAuto();
                break;

            case AutoKlasse.Standard:
                Auto = new StandardAuto();
                break;
            }
        }
示例#3
0
        public void ScenarioNotOkay02Test()
        {
            Auto a1 = new MittelklasseAuto();

            a1.Marke      = "Range Rover";
            a1.Tagestarif = 125;


            Kunde k1 = new Kunde();

            k1.Nachname     = "Simpson";
            k1.Vorname      = "Homer Jay";
            k1.Geburtsdatum = new DateTime(1935, 7, 11);

            Reservation r1 = new Reservation();

            r1.Auto  = a1;
            r1.Kunde = k1;
            r1.Von   = new DateTime(2018, 7, 21);
            r1.Bis   = new DateTime(2018, 7, 21);

            Target.InstertReservation(r1);
        }
示例#4
0
        public void ScenarioOkay02Test()
        {
            Auto a1 = new MittelklasseAuto();

            a1.Marke      = "SmartFor2";
            a1.Tagestarif = 195;


            Kunde k1 = new Kunde();

            k1.Nachname     = "Merkel";
            k1.Vorname      = "Angel";
            k1.Geburtsdatum = new DateTime(1978, 8, 1);

            Reservation r1 = new Reservation();

            r1.Auto  = a1;
            r1.Kunde = k1;
            r1.Von   = new DateTime(2019, 12, 30);
            r1.Bis   = new DateTime(2020, 1, 1);

            Target.InstertReservation(r1);
            Assert.IsTrue(r1.ReservationsNr > 0);
        }
示例#5
0
        public void ScenarioOkay01Test()
        {
            Auto a1 = new MittelklasseAuto();

            a1.Marke      = "Ford Fiesta";
            a1.Tagestarif = 230;


            Kunde k1 = new Kunde();

            k1.Nachname     = "Trump";
            k1.Vorname      = "Donald";
            k1.Geburtsdatum = new DateTime(1942, 8, 1);

            Reservation r1 = new Reservation();

            r1.Auto  = a1;
            r1.Kunde = k1;
            r1.Von   = new DateTime(2018, 7, 21);
            r1.Bis   = new DateTime(2018, 8, 2);

            Target.InstertReservation(r1);
            Assert.IsTrue(r1.ReservationsNr > 0);
        }