public void ValidateCoreEntriesSSGFalseIfNoSSGIDs() { var entry = new Domain2.Hours.Hours { ServiceID = 1 }; var resolver = new CoreValidations(_resolutionServiceMock.Object, null); bool result = resolver.ValidateSSG(entry); Assert.IsFalse(result); }
public void ValidateCoreEntriesSSGTrue() { var entry = new Domain2.Hours.Hours { ServiceID = 1, Date = new DateTime(2017, 1, 1), SSGCaseIDs = new int[] { 1, 2 } }; _resolutionServiceMock.Setup(x => x.EntryMode).Returns(Domain2.Cases.HoursEntryMode.ProviderEntry); var repoMock = GetRepositoryMock(false); var resolver = new CoreValidations(_resolutionServiceMock.Object, repoMock.Object); bool result = resolver.ValidateSSG(entry); Assert.IsTrue(result); }
public void ValidateCoreEntiresSSGAddsWarningIssueOnFinalizedCaseManageEntry() { var entry = new Domain2.Hours.Hours { ServiceID = 1, Date = new DateTime(2017, 1, 1), SSGCaseIDs = new int[] { 1, 2 } }; _resolutionServiceMock.Setup(x => x.EntryMode).Returns(Domain2.Cases.HoursEntryMode.ManagementEntry); _resolutionServiceMock.Setup(x => x.Issues).Returns(new ValidationIssueCollection()); var repoMock = GetRepositoryMock(true); var resolver = new CoreValidations(_resolutionServiceMock.Object, repoMock.Object); bool result = resolver.ValidateSSG(entry); Assert.IsTrue(_resolutionServiceMock.Object.Issues.Issues.Count == 1); Assert.IsTrue(_resolutionServiceMock.Object.Issues.HasWarnings); }
public void ValidateCoreEntriesSSGAddsErrorIssueOnInsufficientCaseCount() { var entry = new Domain2.Hours.Hours { ServiceID = 1, Date = new DateTime(2017, 1, 1), SSGCaseIDs = new int[] { 1 } }; _resolutionServiceMock.Setup(x => x.EntryMode).Returns(Domain2.Cases.HoursEntryMode.ProviderEntry); _resolutionServiceMock.Setup(x => x.Issues).Returns(new ValidationIssueCollection()); var repoMock = GetRepositoryMock(true); var resolver = new CoreValidations(_resolutionServiceMock.Object, repoMock.Object); bool result = resolver.ValidateSSG(entry); Assert.IsTrue(_resolutionServiceMock.Object.Issues.Issues.Count == 1); Assert.IsTrue(_resolutionServiceMock.Object.Issues.HasErrors); }