예제 #1
0
파일: SquareTest.cs 프로젝트: danio/shapes
        public void ConvenienceConstructorShouldHaveSameEffectAsLocationConstructor()
        {
            Vector location = new Vector(3,7);
            int size = 42;
            Square square1 = new Square(location, size);
            Square square2 = new Square(location.X, location.Y, size);

            Assert.AreEqual(square1.ToString(), square2.ToString());
        }
예제 #2
0
        public void AreaShouldReturnWidthSquared()
        {
            double width = 3;
            IShape square = new Square(width);

            var actualArea = square.Area;

            var expectedArea = 9;
            actualArea.Should().Be(expectedArea);
        }