Esempio n. 1
0
        public void InsertValueBeforeIndexRightOfMax()
        {
            var colors     = new[] { Color.Red, Color.Orange, Color.Yellow };
            var colorGraph = new RangeGraph <Color>(colors[0], colors[1]);

            colorGraph.AddValueBefore(5, colors[2]);
            Assert.AreEqual(colors, colorGraph.Values);
        }
Esempio n. 2
0
        public void InsertValuesInTheMiddle()
        {
            var points = new[]
            { Vector2D.Zero, Vector2D.UnitX, Vector2D.UnitY, Vector2D.UnitY, Vector2D.One };
            var pointGraph = new RangeGraph <Vector2D>(points[0], points[4]);

            pointGraph.AddValueAfter(0, points[2]);
            pointGraph.AddValueAfter(1, points[3]);
            pointGraph.AddValueBefore(1, points[1]);
            Assert.AreEqual(points, pointGraph.Values);
        }
Esempio n. 3
0
		public void InsertValuesInTheMiddle()
		{
			var points = new[]
			{ Vector2D.Zero, Vector2D.UnitX, Vector2D.UnitY, Vector2D.UnitY, Vector2D.One };
			var pointGraph = new RangeGraph<Vector2D>(points[0], points[4]);
			pointGraph.AddValueAfter(0, points[2]);
			pointGraph.AddValueAfter(1, points[3]);
			pointGraph.AddValueBefore(1, points[1]);
			Assert.AreEqual(points, pointGraph.Values);
		}
Esempio n. 4
0
		public void InsertValueBeforeIndexRightOfMax()
		{
			var colors = new[] { Color.Red, Color.Orange, Color.Yellow };
			var colorGraph = new RangeGraph<Color>(colors[0], colors[1]);
			colorGraph.AddValueBefore(5, colors[2]);
			Assert.AreEqual(colors, colorGraph.Values);
		}
Esempio n. 5
0
 public void AddValueBefore(int index, Color value)
 {
     colorIntervals.AddValueBefore(index, value);
     UpdateDrawingToRanges();
 }