Beispiel #1
0
        public void IsClockwise_True()
        {
            // Arrange
            var loop = FillFactory.CreateTriangleCW();

            // Act
            bool isClockwise = loop.IsClockwise();

            // Assert
            Assert.IsTrue(isClockwise);
        }
Beispiel #2
0
        public void RollNoEffectCW()
        {
            // Arrange
            var triangle = FillFactory.CreateTriangleCW();

            // Act
            var result = (FillLoop <FillSegment>)triangle.RollBetweenVertices(new ElementLocation(0, 0));

            // Assert
            Assert.AreEqual(3, result.Elements.Count);

            Assert.AreEqual(4, result.Elements[0].NodeStart.x, delta);
            Assert.AreEqual(3, result.Elements[0].NodeStart.y, delta);

            Assert.AreEqual(4, result.Elements[1].NodeStart.x, delta);
            Assert.AreEqual(0, result.Elements[1].NodeStart.y, delta);

            Assert.AreEqual(0, result.Elements[2].NodeStart.x, delta);
            Assert.AreEqual(0, result.Elements[2].NodeStart.y, delta);
        }
Beispiel #3
0
        public void RollFirstSegmentWithinToleranceHighSideCW()
        {
            // Arrange
            var triangle = FillFactory.CreateTriangleCW();

            // Act
            var result = (FillLoop <FillSegment>)triangle.RollBetweenVertices(new ElementLocation(1, 1 - (0.004 / 4)), 0.005);

            // Assert
            Assert.AreEqual(3, result.Elements.Count);

            Assert.AreEqual(0, result.Elements[0].NodeStart.x, delta);
            Assert.AreEqual(0, result.Elements[0].NodeStart.y, delta);

            Assert.AreEqual(4, result.Elements[1].NodeStart.x, delta);
            Assert.AreEqual(3, result.Elements[1].NodeStart.y, delta);

            Assert.AreEqual(4, result.Elements[2].NodeStart.x, delta);
            Assert.AreEqual(0, result.Elements[2].NodeStart.y, delta);
        }