public void TestMonth(string minValue, string maxValue, string rangeStart, string rangeEnd) { var calculator = _host.Services.GetRequiredService <IRangeCalculator>(); calculator.Evaluate(DateTime.Parse(minValue), DateTime.Parse(maxValue)); calculator.Alternatives.Should().NotBeEmpty(); var bestFit = calculator.Alternatives.BestByInactiveRegions(); bestFit.Should().NotBeNull(); bestFit !.RangeStart.Should().Be(MonthNumber.GetMonthNumber(rangeStart)); bestFit !.RangeEnd.Should().Be(MonthNumber.GetMonthNumber(rangeEnd)); }
public void TestDouble(double minValue, double maxValue, double rangeStart, double rangeEnd) { var calculator = _host.Services.GetRequiredService <IRangeCalculator>(); calculator.Evaluate(minValue, maxValue); calculator.Alternatives.Should().NotBeEmpty(); var bestFit = calculator.Alternatives.BestByInactiveRegions(); bestFit.Should().NotBeNull(); bestFit !.RangeStart.Should().Be(rangeStart); bestFit !.RangeEnd.Should().Be(rangeEnd); }
public void DateTimeRangeOfTickSizes(RangeOfDates info) { _rangers.GetRange <DateTime, MonthRange>(info.ControlSize, info.Minimum, info.Maximum, out var result, info) .Should() .BeTrue(); result.Should().NotBeNull(); result !.RangeStart.Should().Be(info.RangeStart); result.RangeEnd.Should().Be(info.RangeEnd); result.MinorValue.Should().Be(info.MinorTick); result.MajorValue.Should().Be(info.MajorTick); }
public void RangeOfTickSizes(RangeOfDates info) { var ranger = new MonthlyTickRange(); ranger.Configure(info); ranger.GetRange(info.ControlSize, info.Minimum, info.Maximum, out var result) .Should() .BeTrue(); result.Should().NotBeNull(); result !.RangeStart.Should().Be(info.RangeStart); result.RangeEnd.Should().Be(info.RangeEnd); result.MinorValue.Should().Be(info.MinorTick); result.MajorValue.Should().Be(info.MajorTick); }