Пример #1
0
        public void LinearInterpolation_Below_2()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(2, 1);
            target.Add(4, 2);
            target.Add(6, 3);
            Assert.AreEqual(8, target.GetAdjustedValue(4));
            Assert.AreEqual(10, target.GetAdjustedValue(5));
        }
Пример #2
0
        public void LinearInterpolation_Middle_1()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(2, 1);
            target.Add(6, 3);
            Assert.AreEqual(2, target.GetAdjustedValue(1));
            Assert.AreEqual(4, target.GetAdjustedValue(2));
            Assert.AreEqual(6, target.GetAdjustedValue(3));
        }
Пример #3
0
        public void LinearInterpolation_OnePoint()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(0, 1);
            Assert.AreEqual(0, target.GetAdjustedValue(1));
        }
Пример #4
0
        public void LinearInterpolation_Above_1()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(11, 10);
            Assert.AreEqual(11, target.GetAdjustedValue(10));
            Assert.AreEqual(10, target.GetAdjustedValue(9));
        }
Пример #5
0
        public void LinearInterpolation_Below_1()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(1, 0);
            Assert.AreEqual(1, target.GetAdjustedValue(0));
            Assert.AreEqual(2, target.GetAdjustedValue(1));
        }