private static void Solve() { var configuration = ConfigurationGenerator.GenerateRandomConfiguration(3, 50); var solver = new BottomCrossSolver(); solver.Solve(configuration).Wait(TestRunner.Timeout); CubeConfigurationAssert.FaceHasCrossOfColour(configuration, FaceType.Down, FaceColour.White); }
public async Task Solve_GivenWhiteOnFrontTopFaceAndMatchingColourOnBackFace_BottomBackCentreIsCorrect() { var solver = new BottomCrossSolver(); var configuration = UnitTests.Helpers.CreateConfiguration(new[] { Rotations.BackClockwise, Rotations.RightAntiClockwise, Rotations.UpperClockwise }, 3); var solution = new List<IRotation>(); await solver.CheckTopLayerForWhite(configuration, solution).ConfigureAwait(true); CubeConfigurationAssert.BottomBackCentreIsCorrect(configuration); }
public async Task Solve_GivenWhiteOnTopLeftFaceMatchingLeftCentre_BottomLeftCentreIsCorrect() { var solver = new BottomCrossSolver(); var configuration = UnitTests.Helpers.CreateConfiguration(new[] { Rotations.Left2 }, 3); var solution = new List<IRotation>(); await solver.CheckTopFaceForWhite(configuration, solution).ConfigureAwait(true); CubeConfigurationAssert.BottomLeftCentreIsCorrect(configuration); }
public async Task Solve_GivenWhiteInBottomFrontLayerAndJoiningFaceIsOnLeft_ExecutesAFrontLeftReverseFront() { var solver = new BottomCrossSolver(); var configuration = UnitTests.Helpers.CreateConfiguration(new[] { Rotations.LeftAntiClockwise, Rotations.FrontAntiClockwise }, 3); var solution = new List<IRotation>(); await solver.CheckBottomLayerForWhite(configuration, solution).ConfigureAwait(true); CollectionAssert.IsSubsetOf(new[] { Rotations.FrontClockwise, Rotations.LeftClockwise, Rotations.FrontAntiClockwise }, solution); }
public async Task Solve_GivenWhiteOnMiddleLeftFaceAndMatchingColourOnRightFace_PlacesWhiteOnToBottomLayer() { var solver = new BottomCrossSolver(); var configuration = UnitTests.Helpers.CreateConfiguration(new[] { Rotations.LeftAntiClockwise}, 3); var solution = new List<IRotation>(); await solver.CheckMiddleLayerForWhite(configuration, solution).ConfigureAwait(true); CollectionAssert.IsSubsetOf(new[] { Rotations.LeftClockwise }, solution); }