Exemplo n.º 1
0
        public void WhatShapeIsThisTest()
        {
            var svc = new MyRedPill();

            //equilateral
            int a, b, c;

            a = b = c = 10;
            var output = svc.WhatShapeIsThis(a, b, c);

            Assert.AreEqual(TriangleType.Equilateral, output, "Equilateral check failed");

            //isosceles
            a      = 5;
            b      = 5;
            c      = 8;
            output = svc.WhatShapeIsThis(a, b, c);
            Assert.AreEqual(TriangleType.Isosceles, output, "Isosceles check failed");

            //scalene
            a      = 5;
            b      = 6;
            c      = 10;
            output = svc.WhatShapeIsThis(a, b, c);
            Assert.AreEqual(TriangleType.Scalene, output, "Scalene check failed");

            //error
            a      = 5;
            b      = 5;
            c      = 11;
            output = svc.WhatShapeIsThis(a, b, c);
            Assert.AreEqual(TriangleType.Error, output, "Error check failed");
        }
Exemplo n.º 2
0
        public void WhatShapeIsThisTest1()
        {
            MyRedPill redPill = new MyRedPill();

            TriangleType type = redPill.WhatShapeIsThis(-1, 0, 0);

            Assert.AreEqual(type, TriangleType.Error);

            type = redPill.WhatShapeIsThis(0, -1, 0);
            Assert.AreEqual(type, TriangleType.Error);

            type = redPill.WhatShapeIsThis(0, 0, -1);
            Assert.AreEqual(type, TriangleType.Error);
        }
Exemplo n.º 3
0
        public void WhatShapeIsThisTest7()
        {
            MyRedPill    redPill = new MyRedPill();
            TriangleType type    = redPill.WhatShapeIsThis(12, 6, 14);

            Assert.AreEqual(type, TriangleType.Scalene);
        }
Exemplo n.º 4
0
        public void WhatShapeIsThisTest5()
        {
            MyRedPill    redPill = new MyRedPill();
            TriangleType type    = redPill.WhatShapeIsThis(2, 1, 3);

            Assert.AreEqual(type, TriangleType.Error);
        }
Exemplo n.º 5
0
        public void WhatShapeIsThisTest3()
        {
            MyRedPill    redPill = new MyRedPill();
            TriangleType type    = redPill.WhatShapeIsThis(2, 2, 2);

            Assert.AreEqual(type, TriangleType.Equilateral);
        }
Exemplo n.º 6
0
        public void WhatShapeIsThisTest2()
        {
            MyRedPill    redPill = new MyRedPill();
            TriangleType type    = redPill.WhatShapeIsThis(2, 2, 1);

            Assert.AreEqual(type, TriangleType.Isosceles);
        }