Ejemplo n.º 1
0
 public void Initialize_Range()
 {
     var range = new Range(new float[] { 12, 10, 5, 15, 25, 20});
     Assert.AreEqual(20, range.Interval);
     Assert.AreEqual(5, range.Min);
     Assert.AreEqual(25, range.Max);
 }
Ejemplo n.º 2
0
        public void ToString_Contains_Relevant_Values()
        {
            var range = new Range(10, 25);
            var rangeString = range.ToString();

            Assert.IsTrue(rangeString.Contains("10"));
            Assert.IsTrue(rangeString.Contains("25"));
            Assert.IsTrue(rangeString.Contains("15"));
        }
Ejemplo n.º 3
0
        public Volume(IList<Point> points)
        {
            var rangeX = new Range(points.Select(p => p.X));
            var rangeY = new Range(points.Select(p => p.Y));
            var rangeZ = new Range(points.Select(p => p.Z));

            this.location = new Point(rangeX.Min, rangeY.Min, rangeZ.Min);
            this.width = rangeX.Interval;
            this.height = rangeY.Interval;
            this.depth = rangeZ.Interval;
        }