public void GetInterpolationValue()
		{
			var points =
				new List<Vector2D>(new[] { Vector2D.UnitX, Vector2D.Zero, Vector2D.One, Vector2D.UnitY });
			var pointsTimeRange = new TimeRangeGraph<Vector2D>(points);
			Assert.IsTrue(
				pointsTimeRange.TrySetAllPercentagesNoOrderChange(
					new List<float>(new[] { 0.0f, 0.2f, 0.7f, 1.0f })));
			const float ExpectedInterpolation = 4.0f / 5.0f;
			Assert.IsTrue(
				pointsTimeRange.GetInterpolatedValue(0.6f).IsNearlyEqual(Vector2D.One *
					ExpectedInterpolation));
			Assert.AreEqual(Vector2D.UnitY, pointsTimeRange.GetInterpolatedValue(1.2f));
			Assert.AreEqual(Vector2D.UnitX, pointsTimeRange.GetInterpolatedValue(-0.1f));
		}
        public void GetInterpolationValue()
        {
            var points =
                new List <Vector2D>(new[] { Vector2D.UnitX, Vector2D.Zero, Vector2D.One, Vector2D.UnitY });
            var pointsTimeRange = new TimeRangeGraph <Vector2D>(points);

            Assert.IsTrue(
                pointsTimeRange.TrySetAllPercentagesNoOrderChange(
                    new List <float>(new[] { 0.0f, 0.2f, 0.7f, 1.0f })));
            const float ExpectedInterpolation = 4.0f / 5.0f;

            Assert.IsTrue(
                pointsTimeRange.GetInterpolatedValue(0.6f).IsNearlyEqual(Vector2D.One *
                                                                         ExpectedInterpolation));
            Assert.AreEqual(Vector2D.UnitY, pointsTimeRange.GetInterpolatedValue(1.2f));
            Assert.AreEqual(Vector2D.UnitX, pointsTimeRange.GetInterpolatedValue(-0.1f));
        }
        public void AddValueAtPercentage()
        {
            var colors          = CreateColorsList();
            var colorsTimeRange = new TimeRangeGraph <Color>(colors);

            colorsTimeRange.AddValueAt(0.9f, Color.Black);
            var expectedColors = new[] { colors[0], colors[1], colors[2], Color.Black, colors[3] };

            Assert.AreEqual(expectedColors, colorsTimeRange.Values);
            Assert.AreEqual(Color.Black, colorsTimeRange.GetInterpolatedValue(0.9f));
        }
		public void AddValueAtPercentage()
		{
			var colors = CreateColorsList();
			var colorsTimeRange = new TimeRangeGraph<Color>(colors);
			colorsTimeRange.AddValueAt(0.9f, Color.Black);
			var expectedColors = new[] { colors[0], colors[1], colors[2], Color.Black, colors[3] };
			Assert.AreEqual(expectedColors, colorsTimeRange.Values);
			Assert.AreEqual(Color.Black, colorsTimeRange.GetInterpolatedValue(0.9f));
		}