Example #1
0
 public NotificationAssessmentStatusTests()
 {
     notificationId         = new Guid("C4C62654-048C-45A2-BF7F-9837EFCF328F");
     notificationAssessment = new NotificationAssessment(notificationId);
     progressService        = A.Fake <INotificationProgressService>();
     A.CallTo(() => progressService.IsComplete(notificationId)).Returns(true);
 }
 public NotificationAssessmentStatusTests()
 {
     notificationId = new Guid("C4C62654-048C-45A2-BF7F-9837EFCF328F");
     notificationAssessment = new NotificationAssessment(notificationId);
     progressService = A.Fake<INotificationProgressService>();
     A.CallTo(() => progressService.IsComplete(notificationId)).Returns(true);
 }
Example #3
0
        public void CantSubmitIncompleteApplication()
        {
            A.CallTo(() => progressService.IsComplete(A <Guid> ._)).Returns(false);

            Action submit = () => notificationAssessment.Submit(progressService);

            Assert.Throws <InvalidOperationException>(submit);
        }
Example #4
0
        public void Submit(INotificationProgressService progressService)
        {
            if (!progressService.IsComplete(NotificationApplicationId))
            {
                throw new InvalidOperationException(string.Format("Cannot submit an incomplete notification: {0}", NotificationApplicationId));
            }

            stateMachine.Fire(Trigger.Submit);
        }
        public SubmitNotificationHandlerTests()
        {
            context = new TestIwsContext();
            progressService = A.Fake<INotificationProgressService>();

            var assessment = new NotificationAssessment(notificationId);

            var repo = A.Fake<INotificationAssessmentRepository>();
            A.CallTo(() => repo.GetByNotificationId(notificationId)).Returns(assessment);

            context.NotificationAssessments.Add(assessment);
            A.CallTo(() => progressService.IsComplete(notificationId)).Returns(true);

            handler = new SubmitNotificationHandler(context, progressService, repo);
            message = new SubmitNotification(notificationId);
        }
Example #6
0
        public SubmitNotificationHandlerTests()
        {
            context         = new TestIwsContext();
            progressService = A.Fake <INotificationProgressService>();

            var assessment = new NotificationAssessment(notificationId);

            var repo = A.Fake <INotificationAssessmentRepository>();

            A.CallTo(() => repo.GetByNotificationId(notificationId)).Returns(assessment);

            context.NotificationAssessments.Add(assessment);
            A.CallTo(() => progressService.IsComplete(notificationId)).Returns(true);

            handler = new SubmitNotificationHandler(context, progressService, repo);
            message = new SubmitNotification(notificationId);
        }
        public void Submit(INotificationProgressService progressService)
        {
            if (!progressService.IsComplete(NotificationApplicationId))
            {
                throw new InvalidOperationException(string.Format("Cannot submit an incomplete notification: {0}", NotificationApplicationId));
            }

            stateMachine.Fire(Trigger.Submit);
        }