コード例 #1
0
 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));
 }
コード例 #2
0
 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));
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 public void CornersOfRectangles_ShouldReturnFourCornerOnDifferentRectangle(int x, int y, int width, int height)
 {
     RectanglesHelper.GetCorners(new Rectangle(x, y, width, height)).Should().HaveCount(4);
 }