예제 #1
0
        public override async Task <AutoDto> DeleteAuto(AutoDto request, ServerCallContext context)
        {
            var auto     = request.ConvertToEntity();
            var response = await autoManager.DeleteAuto(auto);

            return(response.ConvertToDto());
        }
예제 #2
0
        public void DeleteAuto(int id)
        {
            WriteActualMethod();

            try
            {
                _autoManager.DeleteAuto(id);
            }
            catch (InvalidOperationException)
            {
                OutOfRangeFault fault = new OutOfRangeFault()
                {
                    Operation = "delete"
                };

                throw new FaultException <OutOfRangeFault>(fault);
            }
        }
예제 #3
0
        public void InsertAndDeleteAutoTest()
        {
            Auto someCar = new LuxusklasseAuto
            {
                Marke      = "DUDE!",
                Tagestarif = 10,
                Basistarif = 20
            };

            Auto neu = AutoManager.InsertAuto(someCar);

            Auto sameCar = AutoManager.GetAutoById(neu.Id);

            Assert.Equal("DUDE!", someCar.Marke);
            Assert.Equal("DUDE!", sameCar.Marke);

            AutoManager.DeleteAuto(neu);
        }
 public void DeleteAuto(AutoDto autoDto)
 {
     WriteActualMethod();
     AutoManager.DeleteAuto(DtoConverter.ConvertToEntity(autoDto));
 }