예제 #1
0
        public void Block_CreateAndGetFaceWithBadOrientation_ReturnNull()
        {
            // 1. Prepare
            SphericalVector faceOrientation = new SphericalVector(Math.PI, Math.PI);
            Block           b = new TestBlock(new BlockFace("test", faceOrientation));

            // 2. Execute
            BlockFace f = b.GetBlockFace(new SphericalVector(100, 100));

            // 3. Verify
            Assert.Null(f);
        }
예제 #2
0
        public void Block_CreateAndGetFace_ShouldFindFace()
        {
            // 1. Prepare
            SphericalVector faceOrientation = new SphericalVector(Math.PI, Math.PI);

            // 2. Execute
            Block     b = new TestBlock(new BlockFace("test", faceOrientation));
            BlockFace f = b.GetBlockFace(faceOrientation);

            // 3. Verify
            Assert.NotNull(f);
        }
예제 #3
0
        public void Block_RotateAndGetFace_FindFace(string rotationAxisCc, double theta, string faceCc, string expectedCc)
        {
            // 1. Prepare
            Cartesian3dCoordinate axis                = new Cartesian3dCoordinate(rotationAxisCc);
            Cartesian3dCoordinate faceOrientation     = new Cartesian3dCoordinate(faceCc);
            Cartesian3dCoordinate expectedOrientation = new Cartesian3dCoordinate(expectedCc);
            Block b = new TestBlock(new BlockFace("test", faceOrientation));

            // 2. Execute
            b.RotateAround(axis, theta);
            BlockFace f = b.GetBlockFace(expectedOrientation);

            // 3. Verify
            Assert.NotNull(f);
        }
예제 #4
0
        public void Block_CreateRotateAndGetFaceWithOriginalOrientation_ReturnNull(string axisCc, string originalFace, double theta)
        {
            // 1. Prepare
            Cartesian3dCoordinate axis            = new Cartesian3dCoordinate(axisCc);
            Cartesian3dCoordinate faceOrientation = new Cartesian3dCoordinate(originalFace);
            Block b = new TestBlock(new BlockFace("test", faceOrientation));

            b.RotateAround(axis, theta);

            // 2. Execute
            BlockFace f = b.GetBlockFace(faceOrientation);

            // 3. Verify
            Assert.Null(f);
        }