public DateTime TryGetClosestPoint_Success( Dictionary <string, List <CompiledScheduleTimeInterval> > marketsSchedule, DateTime currentDateTime) { var dateServiceMock = new Mock <IDateService>(); dateServiceMock.Setup(x => x.Now()).Returns(currentDateTime); var sut = new ScheduleControlService(Mock.Of <IScheduleSettingsCacheService>(), Mock.Of <ILog>(), dateServiceMock.Object); return(sut.TryGetClosestPoint(marketsSchedule, currentDateTime)); }
public (DateTime Start, DateTime End) TryGetOperatingInterval_Success( List <CompiledScheduleTimeInterval> platformTrading, DateTime currentDateTime, bool expectedResult) { var dateServiceMock = new Mock <IDateService>(); dateServiceMock.Setup(x => x.Now()).Returns(currentDateTime); var sut = new ScheduleControlService(Mock.Of <IScheduleSettingsCacheService>(), Mock.Of <ILog>(), dateServiceMock.Object); var actualResult = sut.TryGetOperatingInterval(platformTrading, currentDateTime, out var resultingInterval); Assert.AreEqual(expectedResult, actualResult); return(resultingInterval); }