Exemplo n.º 1
0
        public void TestCalculate()
        {
            var service = new TriangleTypes();

            Assert.Equal("Equilateral", service.Calculate(3, 3, 3));
            Assert.Equal("Isosceles", service.Calculate(3, 4, 4));
            Assert.Equal("Scalene", service.Calculate(3, 4, 5));
        }
Exemplo n.º 2
0
        public void TestCalculate_Negative()
        {
            var service = new TriangleTypes();

            Assert.Equal("Error", service.Calculate(-3, 3, 3));
            Assert.Equal("Error", service.Calculate(3, -4, 4));
            Assert.Equal("Error", service.Calculate(3, 4, -5));
        }
Exemplo n.º 3
0
        public ActionResult <string> GetTriangleType([FromQuery(Name = "a")] int a, [FromQuery(Name = "b")] int b, [FromQuery(Name = "c")] int c)
        {
            var service = new TriangleTypes();

            return(service.Calculate(a, b, c));
        }