Example #1
0
        public void SettingValueLeftOfAllIndicesExpands()
        {
            var rectangles = new[] { Rectangle.One, Rectangle.Zero, Rectangle.One };
            var rectGraph  = new RangeGraph <Rectangle>(rectangles[1], rectangles[2]);

            rectGraph.SetValue(-1, rectangles[0]);
            Assert.AreEqual(rectangles, rectGraph.Values);
        }
Example #2
0
        public void SetValuesToSeveralGraphTypes()
        {
            var vectorGraph = new RangeGraph <Vector3D>(Vector3D.Zero, Vector3D.UnitZ);
            var colorGraph  = new RangeGraph <Color>(Color.Red, Color.Orange);

            colorGraph.SetValue(1, Color.Gold);
            Assert.AreEqual(Vector3D.Zero, vectorGraph.Start);
            Assert.AreEqual(Vector3D.UnitZ, vectorGraph.Values[1]);
            Assert.AreEqual(Color.Gold, colorGraph.End);
        }
Example #3
0
		public void SetValuesToSeveralGraphTypes()
		{
			var vectorGraph = new RangeGraph<Vector3D>(Vector3D.Zero, Vector3D.UnitZ);
			var colorGraph = new RangeGraph<Color>(Color.Red, Color.Orange);
			colorGraph.SetValue(1, Color.Gold);
			Assert.AreEqual(Vector3D.Zero, vectorGraph.Start);
			Assert.AreEqual(Vector3D.UnitZ, vectorGraph.Values[1]);
			Assert.AreEqual(Color.Gold, colorGraph.End);
		}
Example #4
0
		public void SettingValueLeftOfAllIndicesExpands()
		{
			var rectangles = new[] { Rectangle.One, Rectangle.Zero, Rectangle.One };
			var rectGraph = new RangeGraph<Rectangle>(rectangles[1], rectangles[2]);
			rectGraph.SetValue(-1, rectangles[0]);
			Assert.AreEqual(rectangles, rectGraph.Values);
		}
Example #5
0
 public void SetValue(int index, Color value)
 {
     colorIntervals.SetValue(index, value);
     UpdateDrawingToRanges();
 }