public async Task deleteAutoTest()
        {
            // arrange
            Auto auto = _target.GetByPrimaryKey(1).Result;

            // act
            await _target.DeleteEntity(auto);

            List <Auto> listAfterDeletion = _target.GetAll().Result;

            // assert
            Assert.True(listAfterDeletion.Count == 3);
        }
Пример #2
0
        public override async Task <Empty> DeleteAuto(AutoDto request, ServerCallContext context)
        {
            try
            {
                var entity = request.ConvertToEntity();
                await _manager.DeleteEntity(entity);

                return(new Empty());
            }
            catch (Exception)
            {
                throw new RpcException(new Status(StatusCode.Internal, "Internal error occured."));
            }
        }