public void When_MirrorPlaneTop_Expect_Mirrored() { PointType[][][] blackUp = new PointType[][][] /*x y z*/ { new PointType[][] { new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.BLACK, PointType.BLACK, PointType.BLACK } }, new PointType[][] { new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.BLACK, PointType.BLACK, PointType.BLACK } }, new PointType[][] { new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.BLACK, PointType.BLACK, PointType.BLACK } } }; GridTemplate blackUpGridTemplate = new GridTemplate(blackUp); GridTemplate mirroredBlackUp = GridTemplate.MirrorInPlane(blackUpGridTemplate, PlaneEnum.XZ); PointType[][][] blackDown = new PointType[][][] /*x y z*/ { new PointType[][] { new PointType[] { PointType.BLACK, PointType.BLACK, PointType.BLACK }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED } }, new PointType[][] { new PointType[] { PointType.BLACK, PointType.BLACK, PointType.BLACK }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED } }, new PointType[][] { new PointType[] { PointType.BLACK, PointType.BLACK, PointType.BLACK }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED }, new PointType[] { PointType.IGNORED, PointType.IGNORED, PointType.IGNORED } } }; GridTemplate blackDownGridTemplate = new GridTemplate(blackDown); Assert.AreEqual(blackDownGridTemplate, mirroredBlackUp); }
public void When_MirrorPlane_Expect_Mirrored() { GridTemplate b1 = new GridTemplate(GridTemplate.b1USW); PointType[][][] b1XZMirror = new PointType[][][] /*x y z*/ { new PointType[][] { new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE } }, new PointType[][] { new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.BLACK, PointType.X }, new PointType[] { PointType.WHITE, PointType.X, PointType.X } }, new PointType[][] { new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.X, PointType.X }, new PointType[] { PointType.WHITE, PointType.X, PointType.BLACK } } }; PointType[][][] b1XYMirror = new PointType[][][] /*x y z*/ { new PointType[][] { new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE } }, new PointType[][] { new PointType[] { PointType.X, PointType.X, PointType.WHITE }, new PointType[] { PointType.X, PointType.BLACK, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE } }, new PointType[][] { new PointType[] { PointType.BLACK, PointType.X, PointType.WHITE }, new PointType[] { PointType.X, PointType.X, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE } } }; PointType[][][] b1YZMirror = new PointType[][][] /*x y z*/ { new PointType[][] { new PointType[] { PointType.WHITE, PointType.X, PointType.BLACK }, new PointType[] { PointType.WHITE, PointType.X, PointType.X }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE } }, new PointType[][] { new PointType[] { PointType.WHITE, PointType.X, PointType.X }, new PointType[] { PointType.WHITE, PointType.BLACK, PointType.X }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE } }, new PointType[][] { new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE }, new PointType[] { PointType.WHITE, PointType.WHITE, PointType.WHITE } } }; Assert.Multiple(() => { Assert.AreEqual(new GridTemplate(b1XYMirror), GridTemplate.MirrorInPlane(b1, PlaneEnum.XY)); Assert.AreEqual(new GridTemplate(b1XZMirror), GridTemplate.MirrorInPlane(b1, PlaneEnum.XZ)); Assert.AreEqual(new GridTemplate(b1YZMirror), GridTemplate.MirrorInPlane(b1, PlaneEnum.YZ)); }); }