コード例 #1
0
        public void RectangleTests()
        {
            int area      = 12;
            int perimeter = 14;

            Assert.AreEqual(area, Rec1.GetArea());
            Assert.AreEqual(perimeter, Rec1.GetPerimeter());

            area      = 20;
            perimeter = 18;

            Assert.AreEqual(area, Rec2.GetArea());
            Assert.AreEqual(perimeter, Rec2.GetPerimeter());

            area      = 50;
            perimeter = 30;

            Assert.AreEqual(area, Rec3.GetArea());
            Assert.AreEqual(perimeter, Rec3.GetPerimeter());

            area      = 24;
            perimeter = 20;

            Assert.AreEqual(area, Rec4.GetArea());
            Assert.AreEqual(perimeter, Rec4.GetPerimeter());

            area      = 63;
            perimeter = 32;

            Assert.AreEqual(area, Rec5.GetArea());
            Assert.AreEqual(perimeter, Rec5.GetPerimeter());
        }
コード例 #2
0
        public void RectangleTests()
        {
            int area      = 12;
            int perimeter = 14;

            Assert.AreEqual(area, Rec1.GetArea());
            Assert.AreEqual(perimeter, Rec1.GetPerimeter());

            area      = 20;
            perimeter = 18;

            Assert.AreEqual(area, Rec2.GetArea());
            Assert.AreEqual(perimeter, Rec2.GetPerimeter());
        }