Beispiel #1
0
        public void CreateRandomFigure()
        {
            var figureFactory = new FigureFactory();

            for (var i = 0; i < 100; i++)
            {
                var figure = figureFactory.CreateRandomFigure();
            }
        }
Beispiel #2
0
        public void RotateLeft4TimesShouldNotChange()
        {
            // this test is bad because it is not consistent
            // It relies on random figure
            // We should create a set of non-random figures, but current Figure class does not allow

            var figureFactory = new FigureFactory();
            var figure        = figureFactory.CreateRandomFigure();

            var newFigure = new Figure(figure);

            newFigure.Should().BeEquivalentTo(figure);

            newFigure.RotateLeft();
            newFigure.RotateLeft();
            newFigure.RotateLeft();
            newFigure.RotateLeft();

            newFigure.Should().BeEquivalentTo(figure);
        }