public void TestRectangleEqual()
        {
            var expectedWidth = 10;
            var p1            = new inheritanceandpoly.Point(1, 2);
            var p2            = new inheritanceandpoly.Point(1, 2);

            var s1 = new inheritanceandpoly.Square(p1, expectedWidth);
            var s2 = new inheritanceandpoly.Square(p2, expectedWidth);
            var s3 = new inheritanceandpoly.Shape();

            //Assert

            Assert.AreEqual(s1, s2);
            Assert.AreNotEqual(s2, s3);
        }
Example #2
0
        public void TestRectangleEqual()
        {
            var expectedHeight = 5;
            var expectedWidth  = 10;
            var p1             = new inheritanceandpoly.Point(1, 2);
            var p2             = new inheritanceandpoly.Point(1, 2);

            var r1 = new inheritanceandpoly.Rectangle(p1, expectedWidth, expectedHeight);
            var r2 = new inheritanceandpoly.Rectangle(p2, expectedWidth, expectedHeight);
            var r3 = new inheritanceandpoly.Shape();

            //Assert

            Assert.AreEqual(r1, r2);
            Assert.AreNotEqual(r2, r3);
        }
        public void TestCircleEquals()
        {
            var p1 = new inheritanceandpoly.Point(1, 2);
            var p2 = new inheritanceandpoly.Point(1, 2);

            var c3unequal      = new inheritanceandpoly.Circle(new inheritanceandpoly.Point(2, 2), 23894723);
            var expectedRadius = 5;

            var c5 = new inheritanceandpoly.Shape();

            var c1 = new inheritanceandpoly.Circle(p1, expectedRadius);
            var c2 = new inheritanceandpoly.Circle(p2, expectedRadius);
            var c4 = new inheritanceandpoly.Circle(null, expectedRadius);

            //Assert

            Assert.AreEqual(c1, c2);

            Assert.AreNotEqual(c2, c3unequal);
            Assert.AreEqual(c2, c1);
            Assert.AreNotEqual(c2, c5);
        }