public void Condense_GivenOneLeft2AndOneLeftClockwise_ReturnsLeftAntiClockwise()
        {
            var list = new List<IRotation> { Rotations.Left2, Rotations.LeftClockwise, Rotations.RightClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { Rotations.LeftAntiClockwise, Rotations.RightClockwise }, condensed);
        }
        public void Condense_GivenAListThatCannotBeCondensed_ReturnsTheSameList()
        {
            var list = new List<IRotation> { Rotations.LeftClockwise, Rotations.RightClockwise };

            var condensed = list.Condense();

            Assert.AreEqual(list, condensed);
        }
        public void Condense_GivenTwoLeft2Rotations_RemovesBothRotations()
        {
            var list = new List<IRotation> { Rotations.Left2, Rotations.Left2, Rotations.RightClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { Rotations.RightClockwise }, condensed);
        }
        public void Condense_FaceRotations_RegressionTest1()
        {
            var list = new List<IRotation> { Rotations.LeftClockwise, Rotations.UpperClockwise, Rotations.UpperClockwise, Rotations.UpperAntiClockwise, Rotations.UpperAntiClockwise, Rotations.UpperClockwise, Rotations.LeftClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { Rotations.LeftClockwise, Rotations.UpperClockwise, Rotations.LeftClockwise }, condensed);
        }
        public void Condense_CubeRotationsRegressionTest1()
        {
            var list = new List<IRotation> { CubeRotations.YClockwise, CubeRotations.XClockwise, CubeRotations.XClockwise, CubeRotations.XAntiClockwise, CubeRotations.XAntiClockwise, CubeRotations.XClockwise, CubeRotations.YClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { CubeRotations.YClockwise, CubeRotations.XClockwise, CubeRotations.YClockwise }, condensed);
        }
        public void Condense_GivenFourYClockwise_RemovesAllCubeRotations()
        {
            var list = new List<IRotation> { CubeRotations.YClockwise, CubeRotations.YClockwise, CubeRotations.YClockwise, CubeRotations.YClockwise, CubeRotations.ZClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { CubeRotations.ZClockwise }, condensed);
        }
        public void Condense_GivenThreeYClockwise_ReturnsSingleYAntiClockwise()
        {
            var list = new List<IRotation> { CubeRotations.YClockwise, CubeRotations.YClockwise, CubeRotations.YClockwise, CubeRotations.ZClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { CubeRotations.YAntiClockwise, CubeRotations.ZClockwise }, condensed);
        }
        public void Condense_GivenOneYClockwiseAndOneYAnitClockwiseCubeRotations_RemovesBothCubeRotations()
        {
            var list = new List<IRotation> { CubeRotations.YClockwise, CubeRotations.YAntiClockwise, CubeRotations.ZClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { CubeRotations.ZClockwise }, condensed);
        }
        public void Condense_GivenTwoY2CubeRotations_RemovesBothCubeRotations()
        {
            var list = new List<IRotation> { CubeRotations.Y2, CubeRotations.Y2, CubeRotations.ZClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { CubeRotations.ZClockwise }, condensed);
        }
Exemplo n.º 10
0
        public void Condense_GivenTwoYClockwiseCubeRotations_ReturnsASingleY2Rotation()
        {
            var list = new List<IRotation> { CubeRotations.YClockwise, CubeRotations.YClockwise, CubeRotations.ZClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new[] { CubeRotations.Y2, CubeRotations.ZClockwise }, condensed);
        }
Exemplo n.º 11
0
        public void Condense_GivenAListOfCubeRotationsThatCannotBeCondensed_ReturnsTheSameList()
        {
            var list = new List<IRotation> { CubeRotations.YClockwise, CubeRotations.ZClockwise };

            var condensed = list.Condense();

            Assert.AreEqual(list, condensed);
        }
Exemplo n.º 12
0
        public void Condense_GivenOneLeftClockwiseAndOneLeftAnitClockwiseRotationsOnDifferentLayers_RemovesNoRotations()
        {
            var list = new List<IRotation> { Rotations.SecondLayerLeftClockwise, Rotations.LeftAntiClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(list, condensed);
        }
Exemplo n.º 13
0
        public void Condense_GivenOneLeftClockwiseAndOneLeftAnitClockwiseRotationsOnTheSameLayer_RemovesBothRotations()
        {
            var list = new List<IRotation> { Rotations.SecondLayerLeftClockwise, Rotations.SecondLayerLeftAntiClockwise };

            var condensed = list.Condense();

            CollectionAssert.IsEmpty(condensed);
        }
Exemplo n.º 14
0
        public void Condense_GivenTwoLeftClockwiseRotationsOnTheSameLayer_RemovesBothRotationsAndAddsADoubleRotationForThatLayer()
        {
            var list = new List<IRotation> { Rotations.SecondLayerLeftClockwise, Rotations.SecondLayerLeftClockwise };

            var condensed = list.Condense();

            CollectionAssert.AreEqual(new [] { Rotations.SecondLayerLeft2 }, condensed);
        }