Example #1
0
        public void TestMethod_DetermineShape_is_Octagon()
        {
            // TODO : Write test code
            IShape shape;

            ShapeGeneratorLibrary.ShapeGeneratorLibrary lib;
            lib   = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
            shape = lib.DetermineShape("octagon side length of 100");

            Assert.AreEqual(shape.shapeType, "Octagon");
            Assert.AreEqual(shape.measurements[0], 100);
            Assert.AreEqual(shape.description, "octagon side length of 100");
        }
Example #2
0
        public void TestMethod_DetermineShape_is_Unknown()
        {
            // TODO : Write test code
            IShape shape;

            ShapeGeneratorLibrary.ShapeGeneratorLibrary lib;
            lib   = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
            shape = lib.DetermineShape("dot is 200");

            Assert.IsNotNull(shape);
            Assert.IsNull(shape.shapeType);
            Assert.IsNotNull(shape.description);
        }
Example #3
0
        public void TestMethod_DetermineShape_is_EquilateralTriangle()
        {
            // TODO : Write test code
            IShape shape;

            ShapeGeneratorLibrary.ShapeGeneratorLibrary lib;
            lib   = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
            shape = lib.DetermineShape("equilateral triangle side length of 200");

            Assert.AreEqual(shape.shapeType, "Equilateral Triangle");
            Assert.AreEqual(shape.measurements[0], 200);
            Assert.AreEqual(shape.description, "equilateral triangle side length of 200");
        }
Example #4
0
        public void TestMethod_DetermineShape_is_Circle()
        {
            // TODO : Write test code
            IShape shape;

            ShapeGeneratorLibrary.ShapeGeneratorLibrary lib;
            lib   = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
            shape = lib.DetermineShape("circle radius of 100");

            Assert.AreEqual(shape.shapeType, "Circle");
            Assert.AreEqual(shape.measurements[0], 100);
            Assert.AreEqual(shape.description, "circle radius of 100");
        }
Example #5
0
        public void TestMethod_DetermineShape_is_Parallelogram()
        {
            // TODO : Write test code
            IShape shape;

            ShapeGeneratorLibrary.ShapeGeneratorLibrary lib;
            lib   = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
            shape = lib.DetermineShape("parallelogram width of 400 and height of 500");

            Assert.AreEqual(shape.shapeType, "Parallelogram");
            Assert.AreEqual(shape.measurements[0], 400);
            Assert.AreEqual(shape.measurements[1], 500);
            Assert.AreEqual(shape.description, "parallelogram width of 400 and height of 500");
        }
Example #6
0
        public void TestMethod_DetermineShape_is_ScaleneTriangle()
        {
            // TODO : Write test code
            IShape shape;

            ShapeGeneratorLibrary.ShapeGeneratorLibrary lib;
            lib   = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
            shape = lib.DetermineShape("scalene triangle height of 500 and width of 400");

            Assert.AreEqual(shape.shapeType, "Scalene Triangle");
            Assert.AreEqual(shape.measurements[0], 400);
            Assert.AreEqual(shape.measurements[1], 500);
            Assert.AreEqual(shape.description, "scalene triangle height of 500 and width of 400");
        }
Example #7
0
        public void TestMethod_DetermineShape_is_IsoscelesTriangle()
        {
            // TODO : Write test code
            IShape shape;

            ShapeGeneratorLibrary.ShapeGeneratorLibrary lib;
            lib   = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
            shape = lib.DetermineShape("isosceles triangle width of 200 and height of 400");

            Assert.AreEqual(shape.shapeType, "Isosceles Triangle");
            Assert.AreEqual(shape.measurements[0], 200);
            Assert.AreEqual(shape.measurements[1], 400);
            Assert.AreEqual(shape.description, "isosceles triangle width of 200 and height of 400");
        }
Example #8
0
        public void TestMethod_DetermineShape_is_Oval()
        {
            // TODO : Write test code
            IShape shape;

            ShapeGeneratorLibrary.ShapeGeneratorLibrary lib;
            lib   = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
            shape = lib.DetermineShape("oval height of 200 and width of 100");

            Assert.AreEqual(shape.shapeType, "Oval");
            Assert.AreEqual(shape.measurements[0], 100);
            Assert.AreEqual(shape.measurements[1], 200);
            Assert.AreEqual(shape.description, "oval height of 200 and width of 100");
        }
Example #9
0
 public Form1()
 {
     InitializeComponent();
     lib = new ShapeGeneratorLibrary.ShapeGeneratorLibrary();
 }