コード例 #1
0
        public void TestQuadNoNegativeSides()
        {
            MockQuadrilateral quad1 = new MockQuadrilateral();

            quad1.Side1 = 2;
            quad1.Side2 = 2;
            quad1.Side3 = 2;
            quad1.Side4 = -2;
        }
コード例 #2
0
        public void QuadScalingUpTest()
        {
            MockQuadrilateral quad2 = new MockQuadrilateral(2, 2, 2, 2);

            quad2.Scale(50);
            Assert.AreEqual(3, quad2.Side1);
            Assert.AreEqual(3, quad2.Side2);
            Assert.AreEqual(3, quad2.Side3);
            Assert.AreEqual(3, quad2.Side4);
        }
コード例 #3
0
        public void TestQuadCanComputePerimeter2()
        {
            MockQuadrilateral myQuad = new MockQuadrilateral();

            myQuad.Side1 = 2;
            myQuad.Side2 = 2;
            myQuad.Side3 = 2;
            myQuad.Side4 = 2;
            Assert.AreEqual(8, myQuad.Perimeter());
        }
コード例 #4
0
        public void QuadScalingDownTest()
        {
            MockQuadrilateral quad2 = new MockQuadrilateral(10, 10, 10, 10);

            quad2.Scale(-50);
            Assert.AreEqual(5, quad2.Side1);
            Assert.AreEqual(5, quad2.Side2);
            Assert.AreEqual(5, quad2.Side3);
            Assert.AreEqual(5, quad2.Side4);
        }
コード例 #5
0
        public void TestQuadPerimetersAreTheSame()
        {
            MockQuadrilateral quad1 = new MockQuadrilateral();

            quad1.Side1 = 2;
            quad1.Side2 = 2;
            quad1.Side3 = 2;
            quad1.Side4 = 2;
            MockQuadrilateral quad2 = new MockQuadrilateral(2, 2, 2, 2);

            Assert.AreEqual(quad1.Perimeter(), quad2.Perimeter());
        }
コード例 #6
0
 public void TestQuadNoNegativeSidesInConstructor()
 {
     MockQuadrilateral quad = new MockQuadrilateral(2, -2, 2, 2);
 }
コード例 #7
0
        public void TestQuadrilateralComputePerimeter()
        {
            MockQuadrilateral myQuad = new MockQuadrilateral(2.3F, 3.1F, 1.9F, 3.9F);

            Assert.AreEqual(11.2F, myQuad.Perimeter());
        }
コード例 #8
0
        public void TestQuadAreaNotImplemented()
        {
            MockQuadrilateral myQuad = new MockQuadrilateral();

            myQuad.Area();
        }
コード例 #9
0
        public void TestQuadHasDefaultSize()
        {
            MockQuadrilateral myQuad = new MockQuadrilateral();

            myQuad.Perimeter();
        }
コード例 #10
0
        public void InvalidScaleArgument()
        {
            MockQuadrilateral quad2 = new MockQuadrilateral(2, 2, 2, 2);

            quad2.Scale(0);
        }