Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
		}
Exemplo 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);
		}
Exemplo n.º 5
0
 public void AddValueBefore(int index, Color value)
 {
     colorIntervals.AddValueBefore(index, value);
     UpdateDrawingToRanges();
 }