Example #1
0
        public void ComputeAreaNullTest()
        {
            ShapesFeatures newShapes = new ShapesFeatures(10);

            newShapes.AddNewSequence(" ");
            double area = newShapes.ComputeArea(1);

            // computing for sequence " "
            Assert.That(area, Is.EqualTo(0));
        }
Example #2
0
        public void ComputeAreaSingleCharacterTest()
        {
            ShapesFeatures newShapes = new ShapesFeatures(10);

            newShapes.AddNewSequence("s");
            double area = newShapes.ComputeArea(1);

            // computing for sequence "s"
            Assert.That(area, Is.EqualTo(100));
        }
Example #3
0
        public void ComputeAreaGeneralTest()
        {
            ShapesFeatures newShapes = new ShapesFeatures(10);

            newShapes.AddNewSequence("c s c r");
            double area = newShapes.ComputeArea(1);

            // computing for sequence "c s c r"
            // I made a calculation error, when i computed the area myself for testing, i forgot to double the lenght of size hence got wrong area. Mistake is now rectified.
            Assert.That(area, Is.EqualTo(4341.59));
        }