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))); }
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)); }
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); }