private void SetRequestAppealStatusAndComments(AppealStatus appealStatus, string internalComments, string externalComments) { _request.SelectedAppealStatus = appealStatus; switch (appealStatus) { case AppealStatus.Successful: _request.SuccessfulText = internalComments; _request.SuccessfulExternalText = externalComments; break; case AppealStatus.SuccessfulAlreadyActive: _request.SuccessfulAlreadyActiveText = internalComments; _request.SuccessfulAlreadyActiveExternalText = externalComments; break; case AppealStatus.Unsuccessful: _request.UnsuccessfulText = internalComments; _request.UnsuccessfulExternalText = externalComments; break; case AppealStatus.UnsuccessfulPartiallyUpheld: _request.UnsuccessfulPartiallyUpheldText = internalComments; _request.UnsuccessfulPartiallyUpheldExternalText = externalComments; break; } }
public IEnumerable <Test> GetAllAppealTests(string searchString, DateTime?FromAppealTime, DateTime?ToAppealTime, AppealStatus status) { int parsResult; int.TryParse(searchString, out parsResult); return(IDAL.GetAllTests(t => t.AppealTest != null && (searchString == null || t.TestID == parsResult || t.TesterID.Contains(searchString) || t.TraineeID.Contains(searchString) || t.AppealTest.TraineeNotes.Contains(searchString) || t.AppealTest.Decision.Contains(searchString)) && (FromAppealTime == null || t.AppealTest.RequestTime >= FromAppealTime) && (ToAppealTime == null || t.AppealTest.RequestTime <= ToAppealTime) && (status == default(BE.AppealStatus) || t.AppealTest.appealStatus == status))); }
public void OversightOutcomeValidator_appeal_returns_errors_when_comments_are_empty(AppealStatus appealStatus, string internalComments, string externalComments, bool expectError) { SetRequestAppealStatusAndComments(appealStatus, internalComments, externalComments); var result = _validator.Validate(_request, options => options.IncludeRuleSets(OutcomePostRequestValidator.RuleSets.AppealOutcome)); Assert.AreEqual(!expectError, result.IsValid); }