示例#1
0
        public void GivenAddFigureToBoxWhenFiguresMoreThen20ThenOutIsIndexOutOfRangeException(Figure[] actualFigure, List <Figure> expectedRectangleFigureList)
        {
            //Arrange
            BoxForFigures boxForFigures = new BoxForFigures();

            //Act
            if (actualFigure != null)
            {
                foreach (Figure item in actualFigure)
                {
                    boxForFigures.AddFigureToBox(item);
                }
            }
            boxForFigures.AddFigureToBox(new Circle(31, Material.Paper));
            //Assert
            Assert.Throws <IndexOutOfRangeException>(() => boxForFigures.AddFigureToBox(new Circle(31, Material.Paper)));
        }
示例#2
0
        public Figure GivenExecuteFigureByIdWhenByIdThenOutIsFigure(Figure[] actualFigure, int figureId)
        {
            //Arrange
            BoxForFigures boxForFigures = new BoxForFigures();

            //Act
            if (actualFigure != null)
            {
                foreach (Figure item in actualFigure)
                {
                    boxForFigures.AddFigureToBox(item);
                }
            }

            //Assert
            return(boxForFigures.ExecuteFigureById(figureId));
        }
示例#3
0
        public void GivenAddFigureToBoxWhenFigureIsDifferentThenOutIsFigureList(Figure[] actualFigure, List <Figure> expectedRectangleFigureList)
        {
            //Arrange
            BoxForFigures boxForFigures = new BoxForFigures();
            List <Figure> actualBoxList;

            //Act
            if (actualFigure != null)
            {
                foreach (Figure item in actualFigure)
                {
                    boxForFigures.AddFigureToBox(item);
                }
            }
            actualBoxList = boxForFigures.FigureList;

            //Assert
            Assert.AreEqual(expectedRectangleFigureList, actualBoxList);
        }