public void ValidateProviderNotSelfOverlapTrueIfNoOverlaps() { var entry = new Domain2.Hours.Hours { Date = new DateTime(2017, 1, 1), StartTime = new TimeSpan(12, 30, 0), EndTime = new TimeSpan(13, 30, 0) }; ResetService(); _serviceMock.Setup(x => x.EntryMode).Returns(Domain2.Cases.HoursEntryMode.ProviderEntry); _serviceMock.Setup(x => x.AllProposedProviderHours).Returns(() => _selfOverlapHours); _serviceMock.Setup(x => x.Provider).Returns(new Domain2.Providers.Provider() { ID = 5, ProviderTypeID = 17 }); _serviceMock.Setup(x => x.Issues).Returns(new ValidationIssueCollection()); _serviceMock.Object.AllProposedProviderHours.Add(entry); var resolver = new CaseAndProviderValidations(_serviceMock.Object); var result = resolver.ValidateProviderNotSelfOverlap(entry); Assert.IsTrue(result); Assert.IsTrue(_serviceMock.Object.Issues.Issues.Count == 0); }
public void ValidateProviderNotSelfOverlapIgnoresBCBAs() { var entry = new Domain2.Hours.Hours { Date = new DateTime(2017, 1, 1), StartTime = new TimeSpan(1, 30, 0), EndTime = new TimeSpan(2, 30, 0) }; ResetService(); _serviceMock.Setup(x => x.AllProposedProviderHours).Returns(() => _selfOverlapHours); _serviceMock.Setup(x => x.Provider).Returns(new Domain2.Providers.Provider() { ID = 5, ProviderTypeID = 15 }); _serviceMock.Object.AllProposedProviderHours.Add(entry); var resolver = new CaseAndProviderValidations(_serviceMock.Object); var result = resolver.ValidateProviderNotSelfOverlap(entry); Assert.IsTrue(result); }