Ejemplo n.º 1
0
        public void _5_ShouldNotDecreaseTheWithOfTheRectangleUnderZero()
        {
            AssertHasButtons();
            AssertHasCanvasWithRectangle();

            _rectangle.Width = 0;
            _shrinkButton.FireClickEvent();
            var newWidth = _rectangle.Width;

            Assert.That(newWidth, Is.Zero,
                        () =>
                        "The width of the rectangle may not shrink to a value less than zero.");
        }
Ejemplo n.º 2
0
        public void _6_ShouldNotIncreaseTheWidhtOfTheRectanglePassTheCanvasBorder()
        {
            AssertHasButtons();
            AssertHasCanvasWithRectangle();

            var maxRectangleWidth = _canvas.Width - _rectangle.Margin.Left;

            _rectangle.Width = maxRectangleWidth;
            _growButton.FireClickEvent();
            var newWidth = _rectangle.Width;

            Assert.That(newWidth, Is.EqualTo(maxRectangleWidth),
                        () =>
                        "The rectangle may not grow wider than the width of the canvas minus the x-position of the rectangle");
        }