예제 #1
0
        public void TestComputeArea()
        {
            ShapeFactory sf = new SquareFactory();

            Square square = (Square)sf.Create2dShape();

            square.SetSquare(2, 2, 2);
            Assert.AreEqual(4, square.ComputeArea(), 0);
        }
예제 #2
0
        public void TestValidConstruction()
        {
            ShapeFactory sf = new SquareFactory();

            Square square = (Square)sf.Create2dShape();

            square.SetSquare(1, 2, 3);
            Assert.AreEqual(1, square.Point1.X);
            Assert.AreEqual(2, square.Point1.Y);
        }
예제 #3
0
        public void TestMove()
        {
            ShapeFactory sf = new SquareFactory();

            Square square = (Square)sf.Create2dShape();

            square.SetSquare(1, 2, 3);
            square.Move(2, 3);
            Assert.AreEqual(3, square.Point1.X);
            Assert.AreEqual(5, square.Point1.Y);
        }