public void FromMinMax()
        {
            var interval = ClosedInterval.FromMinMax(1, 4);

            Assert.That(interval.Min, Is.EqualTo(1));
            Assert.That(interval.Max, Is.EqualTo(4));
        }
示例#2
0
        public void SetViewport_WhenCalled_ViewportRangeIsApplied()
        {
            var series = CreateSeries(new TV(1, 1), new TV(2, 2), new TV(3, 3), new TV(4, 4));

            var viewport = new SimpleSeriesViewport(series, ClosedInterval.FromMinMax(int.MinValue, int.MaxValue));

            viewport.ViewPort = ClosedInterval.FromOffsetLength(2, 2);

            var expectedSeries = new[] { new TV(2, 2), new TV(3, 3) };

            Assert.That(viewport.Series, Is.EquivalentTo(expectedSeries));
        }