public async Task LineOnTop_GivenHorizontalLine_CreatesACrossOnTop()
        {
            var configuration = CreateConfigurationWithHorizontalLine();
            var solver = new TopCrossSolver();

            await solver.Solve(configuration).ConfigureAwait(true);


            CubeConfigurationAssert.FaceHasCrossOfColour(configuration, FaceType.Upper, FaceColour.Yellow);
        }
        public async Task LineOnTop_GivenLShapeOnBackLeft_CreatesACrossOnTop()
        {
            var configuration = CreateConfigurationWithLOnBackAndLeft();
            var solver = new TopCrossSolver();

            await solver.Solve(configuration).ConfigureAwait(true);


            CubeConfigurationAssert.FaceHasCrossOfColour(configuration, FaceType.Upper, FaceColour.Yellow);
        }
        public void Solve_GivenARandomConfiguration_ProducesACorrectlyPermutedCross()
        {
            TestRunner.RunTestMultipleTimes(TestRunner.MultipleTimesToRun, () =>
            {
                var configuration = CreateSolvedMiddleLayerConfiguration(50);
                var solver = new TopCrossSolver();

                solver.Solve(configuration).Wait();

                CubeConfigurationAssert.TopLayerCrossIsCorrect(configuration);
            });
        }
        public void Solve_GivenARandomConfiguration_ProducesASolvedCross()
        {
            TestRunner.RunTestMultipleTimes(TestRunner.MultipleTimesToRun, () =>
            {
                var configuration = CreateSolvedMiddleLayerConfiguration(50);
                var solver = new TopCrossSolver();

                solver.Solve(configuration).Wait();

                CubeConfigurationAssert.FaceHasCrossOfColour(configuration, FaceType.Upper, FaceColour.Yellow);
            });
        }
        public async Task LineOnTop_GivenVerticalLine_CreatesACrossOnTop()
        {
            var config = Helpers.CreateSolvedMiddleLayerConfiguration(new[] { Rotations.Right2, Rotations.FrontAntiClockwise });
            await config.Rotate(Rotations.UpperClockwise).ConfigureAwait(true);

            var configuration = config;
            var solver = new TopCrossSolver();

            await solver.Solve(configuration).ConfigureAwait(true);


            CubeConfigurationAssert.FaceHasCrossOfColour(configuration, FaceType.Upper, FaceColour.Yellow);
        }
        public async Task Permute_GivenCrossWithLeftCorrectOthersNeedAntiClockwisePermutation_CompletesSolvedCross()
        {
            var configuration = Helpers.CreateSolvedMiddleLayerConfiguration(new[] { Rotations.DownAntiClockwise, Rotations.BackClockwise });
            var solver = new TopCrossSolver();
            await solver.SolveCross(configuration, new List<IRotation>()).ConfigureAwait(true);

            await configuration.Rotate(Rotations.Upper2).ConfigureAwait(true);


            await solver.Solve(configuration).ConfigureAwait(true);


            CubeConfigurationAssert.TopLayerCrossIsCorrect(configuration);
        }
        public async Task Permute_GivenCrossWithDiagonalsReversed_CompletesSolvedCross()
        {
            var configuration = CreateConfigurationWithCrossWithOneOpposingEdge();
            await configuration.Rotate(Rotations.UpperClockwise).ConfigureAwait(true);

            var solver = new TopCrossSolver();

            await solver.Solve(configuration).ConfigureAwait(true);


            CubeConfigurationAssert.TopLayerCrossIsCorrect(configuration);
        }
        public async Task Permute_GivenCrossWithFrontAndBackReversed_CompletesSolvedCross()
        {
            var configuration = CreateConfigurationWithCrossWithOneOpposingEdge();
            var solver = new TopCrossSolver();

            await solver.Solve(configuration).ConfigureAwait(true);


            CubeConfigurationAssert.TopLayerCrossIsCorrect(configuration);
        }
        public async Task Permute_GivenAnAlreadySolvedCross_CompletesSolvedCross()
        {
            var configuration = CreateConfigurationWithSolvedCross();
            var solver = new TopCrossSolver();

            await solver.Solve(configuration).ConfigureAwait(true);


            CubeConfigurationAssert.TopLayerCrossIsCorrect(configuration);
        }