Exemplo n.º 1
0
 public void PeekNextRotation_Should_Return_TetrisCup_With_Next_Rotation()
 {
     var figure = new Figure();
     figure.Pattern = new PatternLibrary().Patterns[1];
     figure.RotationNumber = 3;
     var expectedCup = new PatternLibrary().Patterns[1].Rotations[0];
     var actualCup = figure.PeekNextRotation();
     //сравнение чашек
     if ((actualCup.Width == expectedCup.Width) && (actualCup.Height == expectedCup.Height))
     {
         for (int x=0; x<actualCup.Width; x++)
             for (int y=0; y<actualCup.Height; y++)
                 if (actualCup.GetColorOfPoint(new Point(x, y)) != expectedCup.GetColorOfPoint(new Point(x,y)))
                     throw new Exception();
     }
 }
Exemplo n.º 2
0
        public void PeekNextRotation_Should_Return_TetrisCup_With_Next_Rotation()
        {
            var figure = new Figure();

            figure.Pattern        = new PatternLibrary().Patterns[1];
            figure.RotationNumber = 3;
            var expectedCup = new PatternLibrary().Patterns[1].Rotations[0];
            var actualCup   = figure.PeekNextRotation();

            //сравнение чашек
            if ((actualCup.Width == expectedCup.Width) && (actualCup.Height == expectedCup.Height))
            {
                for (int x = 0; x < actualCup.Width; x++)
                {
                    for (int y = 0; y < actualCup.Height; y++)
                    {
                        if (actualCup.GetColorOfPoint(new Point(x, y)) != expectedCup.GetColorOfPoint(new Point(x, y)))
                        {
                            throw new Exception();
                        }
                    }
                }
            }
        }