Ejemplo n.º 1
0
 /// <summary>
 /// Checking list of digits that they are really the dimensions of sides of triangle
 /// </summary>
 /// <param name="a">The first size of side</param>
 /// <param name="b">The second size of side</param>
 /// <param name="c">The third size of side</param>
 /// <returns>The triangle type</returns>
 public TriangleType WhatShapeIsThis(int a, int b, int c)
 {
     try
     {
         return(ReadifyFactory.WhatShapeIsThis(a, b, c));
     }
     catch (Exception ex)
     {
         Trace.TraceError("Error invoking WhatShapeIsThis. a: {0}, b: {1}, c: {2}, Error: {3}", a, b, c, ex);
         throw new FaultException("Sorry, there happened something unexpected!!!");
     }
 }
Ejemplo n.º 2
0
        public void ShapeBordersNotConnect()
        {
            var res = ReadifyFactory.WhatShapeIsThis(3, 4, 10);

            Assert.AreEqual(TriangleType.Error, res);
        }
Ejemplo n.º 3
0
        public void ShapeSideIsNegative()
        {
            var res = ReadifyFactory.WhatShapeIsThis(-1, 3, 7);

            Assert.AreEqual(TriangleType.Error, res);
        }
Ejemplo n.º 4
0
        public void ShapeIsScalene()
        {
            var res = ReadifyFactory.WhatShapeIsThis(5, 3, 7);

            Assert.AreEqual(TriangleType.Scalene, res);
        }
Ejemplo n.º 5
0
        public void ShapeIsIsosceles()
        {
            var res = ReadifyFactory.WhatShapeIsThis(2, 1, 2);

            Assert.AreEqual(TriangleType.Isosceles, res);
        }
Ejemplo n.º 6
0
        public void ShapeIsEquilateral()
        {
            var res = ReadifyFactory.WhatShapeIsThis(1, 1, 1);

            Assert.AreEqual(TriangleType.Equilateral, res);
        }