public void Sprint_service_Delete_method_should_throw_null_exception_with_empty_input_object()
        {
            var mockRepo = new Mock <ISprintRepository>();

            mockRepo.Setup(x => x.Delete(It.IsAny <int>()));
            SprintService obj       = new SprintService(mockRepo.Object);
            var           exception = Record.Exception(() => obj.Delete(It.IsAny <int>()));

            Assert.Equal(null, exception);
        }
        public void Sprint_service_Delete_method_should_throw_nullReferenceException()
        {
            var mockRepo = new Mock <ISprintRepository>();

            mockRepo.Setup(x => x.Delete(It.IsAny <int>())).Throws(new NullReferenceException());
            SprintService obj       = new SprintService(mockRepo.Object);
            var           exception = Record.Exception(() => obj.Delete(It.IsAny <int>()));

            Assert.IsType <NullReferenceException>(exception);
        }
        public void DeleteSprintTest()
        {
            var mock = new Mock <IUnitOfWork>()
            {
                DefaultValue = DefaultValue.Mock
            };
            var           newSprint = new SprintDTO();
            SprintService service   = new SprintService(mock.Object);

            service.Create(newSprint);
            service.Delete(newSprint);
            mock.Verify(i => i.Save());
        }
Ejemplo n.º 4
0
 public static void Delete(IDictionary <string, object> sprint)
 {
     try
     {
         service.Delete(Utils.ToObject <Engineer.EMF.Sprint>(sprint));
     }
     catch (BadRequestException e)
     {
         throw new Exception(e.ErrorMessage);
     }
     catch (NotExistItemException e)
     {
         throw new Exception(e.ErrorMessage);
     }
 }