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); }
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); }
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); }
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); }
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); }