コード例 #1
0
        public void DeleteAutoTest()
        {
            AutoManager autoManager = new AutoManager();
            Auto        auto        = autoManager.Auto(1);

            autoManager.Delete(auto);
            autoManager.Auto(1);
        }
コード例 #2
0
        public void UpdateAutoTest()
        {
            AutoManager autoManager = new AutoManager();
            Auto        auto        = autoManager.Auto(1);

            auto.Marke      = "Fiat Multipla";
            auto.Tagestarif = 100;
            Auto updatedAuto = autoManager.Update(auto);

            Assert.AreEqual("Fiat Multipla", updatedAuto.Marke);
            Assert.AreEqual(100, updatedAuto.Tagestarif);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public void GetAuto(int id)
        {
            WriteActualMethod();
            IAutoReservationResultCallback cb = _createCallbackChannel();

            try
            {
                cb.SendAuto(autoManager.Auto(id).ConvertToDto());
            }
            catch (EntityNotFoundException ex)
            {
                cb.SendFault(new CommunicationFault {
                    Exception = ex.Message
                });
            }
        }