Beispiel #1
0
        public void CalculatePositions_TwoSquarePoints_ReturnFourPoints()
        {
            // arrange
            service = new TwoDimensionsMeshService
            {
                Xs = new double[] { 0, 1, 2 },
                Ys = new double[] { 0, 1 }
            };

            // act
            var result = service.CalculatePositions();

            // assert
            Assert.AreEqual("0,0,0 1,0,0 2,0,0 0,1,0 1,1,0 2,1,0", result);
        }
Beispiel #2
0
        public void CalculateTriangleIndices_TwoSquarePoints_ReturnTwoFacesIndices()
        {
            // arrange
            service = new TwoDimensionsMeshService
            {
                Xs = new double[] { 0, 1, 2 },
                Ys = new double[] { 0, 1 }
            };

            // act
            var result = service.CalculateTriangleIndices();

            // assert
            Assert.AreEqual(new int[] { 0, 1, 4, 4, 3, 0, 1, 2, 5, 5, 4, 1 }, result);
        }
Beispiel #3
0
        public void CanDrawTests(double[] x, double[] y, bool expected)
        {
            // arrange
            service = new TwoDimensionsMeshService
            {
                Xs = x,
                Ys = y
            };

            // act
            var result = service.CanDraw();

            // assert
            Assert.AreEqual(expected, result);
        }