public void Validate_DoesNotRaiseValidationFailedEvent_WhenEventCodeIsOutpatientDischarged()
        {
            // Arrange
            var eventRaised = false;

            _clockStoppingCompletedEvent.Name = new EventName {
                Code = EventCode.OutpatientDischarged, Description = "Outpatient Discharged"
            };
            _clockStoppingCompletedEvent.ValidationFailed += delegate { eventRaised = true; };

            // Act
            _clockStoppingCompletedEvent.Validate();

            // Assert
            Assert.IsFalse(eventRaised);
        }
예제 #2
0
        public void Validate_DoesNotRaiseValidationFailedEvent_WhenClockStopsAndEventPathwayCompletion()
        {
            //Arrange
            var completedEvent = new ClockStoppingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.PathwayCompletion
                }, Period = new RTT18WeekPeriod {
                    Name = "period 1", Pathway = new Pathway {
                        PPINumber = "ppi"
                    }
                }
            };
            var eventRaised = false;

            completedEvent.ValidationFailed += delegate { eventRaised = true; };

            //Act
            completedEvent.Validate();

            //Assert
            Assert.IsFalse(eventRaised);
        }
예제 #3
0
        public void Validate_RaisesValidationFailedEvent_WhenClockStopsAndEventOtherThanPathwayCompletion()
        {
            //Arrange
            var completedEvent = new ClockStoppingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.DiagnosticsOrderPlaced
                }, Period = new RTT18WeekPeriod {
                    Name = "period 1", Pathway = new Pathway {
                        PPINumber = "ppi"
                    }
                }
            };
            RuleViolation eventRaised = null;

            completedEvent.ValidationFailed += delegate { eventRaised = new RuleViolation(); };

            //Act
            completedEvent.Validate();

            //Assert
            Assert.IsNotNull(eventRaised);
        }
예제 #4
0
        public void Validate_RaisesValidationFailedEvent_WhenClockStopsAndEventOtherThanInpatientDischarged()
        {
            //Arrange
            var completedEvent = new ClockStoppingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.PatientAddedToInpatientWaitingList
                }, Period = new RTT18WeekPeriod {
                    Name = "period 1", Pathway = new Pathway {
                        PPINumber = "ppi"
                    }
                }
            };
            var eventRaised = false;

            completedEvent.ValidationFailed += delegate { eventRaised = true; };

            //Act
            completedEvent.Validate();

            //Assert
            Assert.IsTrue(eventRaised);
        }
예제 #5
0
        public void Validate_DoesNotRaiseValidationFailedEvent_WhenClockStopsAndEventOutpatientDischarged()
        {
            //Arrange
            var completedEvent = new ClockStoppingCompletedEvent {
                Name = new EventName {
                    Code = EventCode.OutpatientDischarged
                }, Period = new RTT18WeekPeriod {
                    Name = "period 1", Pathway = new Pathway {
                        PPINumber = "ppi"
                    }
                }
            };
            RuleViolation eventRaised = null;

            completedEvent.ValidationFailed += delegate { eventRaised = new RuleViolation(); };

            //Act
            completedEvent.Validate();

            //Assert
            Assert.IsNull(eventRaised);
        }