public async Task NotSaveNameExist()
        {
            var carModel = new CarModel()
            {
                Name = "test-save"
            };
            await _repository.Add(carModel);

            Exception exception = null;

            try
            {
                await _service.Execute(carModel);
            }catch (RegisterExistException e)
            {
                exception = e;
            }

            Assert.AreNotEqual(exception, null);
        }
Beispiel #2
0
        public async Task DeleteModelSucess()
        {
            var model = new CarModel()
            {
                Id = 15,
            };

            await _repository.Add(model);

            Exception exception = null;

            try
            {
                await _service.Execute(15);
            }catch (Exception ex)
            {
                exception = ex;
            }
            Assert.AreEqual(exception, null);
        }