Exemple #1
0
        public void TestgetOriginalLocationOfCurrentCubicleInLocation()
        {
            Rubik myRubik = new Rubik();

            myRubik.rotateFace(new Rotation(Face.F, Direction.CW));
            Location yaki = myRubik.getOriginalLocationOfCurrentCubicleInLocation(new Location(Face.D, Face.F));

            Assert.AreEqual(true, (new Location(Face.F, Face.R))
                            .equals(myRubik.getOriginalLocationOfCurrentCubicleInLocation(new Location(Face.D, Face.F))));
        }
Exemple #2
0
 static void myAssertEdge(Face p_firstFace, Face p_secondFace, Rubik p_rubik)
 {
     Assert.AreEqual(true, (new Location(p_firstFace, p_secondFace))
                     .equals(p_rubik.getOriginalLocationOfCurrentCubicleInLocation(new Location(p_firstFace, p_secondFace)))
                     , "Problem with edge " + Char.ToString(p_firstFace.getChar())
                     + " / " + Char.ToString(p_secondFace.getChar()));
 }
Exemple #3
0
        public void constuctorTest()
        {
            Rubik myRubik            = new Rubik();
            int   numberOfAssertions = 0;

            foreach (Face firstFaceDimension in Enum.GetValues(typeof(Face)))
            {
                foreach (Face secondFaceDimension in Enum.GetValues(typeof(Face)))
                {
                    if (firstFaceDimension != secondFaceDimension &&
                        firstFaceDimension.getOpposite() != secondFaceDimension
                        //                        && firstFaceDimension != Face.NOTDEFINED
                        //                        && secondFaceDimension != Face.NOTDEFINED
                        )
                    {
                        Assert.AreEqual(true,
                                        (new Location(firstFaceDimension, secondFaceDimension))
                                        .equals(myRubik.getOriginalLocationOfCurrentCubicleInLocation(new Location(firstFaceDimension, secondFaceDimension))));
                        numberOfAssertions++;
                    }
                }
            }
            Assert.AreEqual(24, numberOfAssertions);
        }