public void GetAllPossiblePosition_ShouldReturnPositionThatHaveCornerInLocation(int x, int y, int width, int height) { RectanglesHelper.GetAllPossibleRectangles(new Point(x, y), new Size(width, height)) .Should().Contain(new Rectangle(x, y, width, height)) .And.Contain(new Rectangle(x - width, y, width, height)) .And.Contain(new Rectangle(x, y - height, width, height)) .And.Contain(new Rectangle(x - width, y - height, width, height)); }
public void CornersOfRectangles_ShouldReturnCorrectCorner(int x, int y, int width, int height) { RectanglesHelper.GetCorners(new Rectangle(x, y, width, height)) .Should().Contain(new Point(x, y)) .And.Contain(new Point(x + width, y + height)) .And.Contain(new Point(x, y + height)) .And.Contain(new Point(x + width, y)); }
public void GetAllPossiblePosition_ShouldReturnFourDifferentPosition(int x, int y, int width, int height) { RectanglesHelper.GetAllPossibleRectangles(new Point(x, y), new Size(width, height)).Should() .HaveCount(4).And.OnlyHaveUniqueItems(); }
public void CornersOfRectangles_ShouldReturnFourCornerOnDifferentRectangle(int x, int y, int width, int height) { RectanglesHelper.GetCorners(new Rectangle(x, y, width, height)).Should().HaveCount(4); }