Ejemplo n.º 1
0
        public void Painted_Area_When222_Returns16()
        {
            //Arrange

            double length = 2;
            double width  = 2;
            double height = 2;

            //Act
            double paintedArea = PaintRoom.PaintedArea(length, width, height);

            //Asserts
            Assert.AreEqual("16", paintedArea);
        }
Ejemplo n.º 2
0
        public void Painted_Area_When000_Returns0()
        {
            //Arrange

            double length = 0;
            double width  = 0;
            double height = 0;

            //Act
            double paintedArea = PaintRoom.PaintedArea(length, width, height);

            //Asserts
            Assert.AreEqual("0", paintedArea);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            //enter the length of the room
            Console.WriteLine("Enter the length (long) of the room:");
            double length = Double.Parse(Console.ReadLine());

            //enter the width of the room
            Console.WriteLine("Enter the width of the room:");
            double width = Double.Parse(Console.ReadLine());

            //enter the height of the room
            Console.WriteLine("Enter the height of the room:");
            double height = Double.Parse(Console.ReadLine());

            //call the methods and output the results

            double floorarea = PaintRoom.FloorArea(length, width);

            if (floorarea == 0)
            {
                Console.WriteLine("Invalid value");

                Console.Write("Press enter to exit... ");
                while (Console.ReadKey().Key != ConsoleKey.Enter)
                {
                    ;
                }
            }
            Console.WriteLine("The Area of the Floor is:" + floorarea);

            double wallarea = PaintRoom.PaintedArea(length, width, height);

            Console.WriteLine("The paint required for the walls is:" + wallarea);

            double volume = PaintRoom.Volume(length, width, height);

            Console.WriteLine("The volume of the room is:" + volume);


            //prints text but keeps cursor in same line
            Console.Write("Press enter to exit... ");
            while (Console.ReadKey().Key != ConsoleKey.Enter)
            {
                ;
            }
        }