Exemplo n.º 1
0
        public void GetTriangleType_ValidTriangle_ReturnsTriangleType(Triangle.TriangleType type, params string[] sides)
        {
            BigInteger[] parsedSides = sides.Select(side => BigInteger.Parse(side)).ToArray();
            TriangleType resultType  = TriangleProgram.GetTriangleType(parsedSides);

            Assert.Equal(type, resultType);
        }
Exemplo n.º 2
0
        public void Test_That_Triangle_Type_NotTriangle()
        {
            Triangle.TriangleType expected = Triangle.TriangleType.Invalid;
            Triangle.TriangleType result   = Triangle.Triangle.GetTriangleType(-60, 75, 82);

            Assert.AreEqual(expected, result);
        }
Exemplo n.º 3
0
        public void Test_That_Triangle_Type_Scalene()
        {
            Triangle.TriangleType expected = Triangle.TriangleType.Scalene;
            Triangle.TriangleType result   = Triangle.Triangle.GetTriangleType(50, 40, 30);

            Assert.AreEqual(expected, result);
        }
Exemplo n.º 4
0
        public void Test_That_Triangle_Type_Isosceles()
        {
            Triangle.TriangleType expected = Triangle.TriangleType.Isosceles;
            Triangle.TriangleType result   = Triangle.Triangle.GetTriangleType(30, 30, 20);

            Assert.AreEqual(expected, result);
        }
Exemplo n.º 5
0
        public void Test_That_Triangle_Type_Equilateral()
        {
            Triangle.TriangleType expected = Triangle.TriangleType.Equilateral;
            Triangle.TriangleType result   = Triangle.Triangle.GetTriangleType(60, 60, 60);

            Assert.AreEqual(expected, result);
        }
Exemplo n.º 6
0
        public async void SrvTriangleType_ReturnExpectedValue_WhenIndexIsInlineData(int sideA, int sideB, int sideC, Triangle.TriangleType expected)
        {
            // Arrange
            var triangleTypeServices = _triangleTypeFixture.TriangleTypeService;

            // Act
            var result = await triangleTypeServices.SrvTriangleType(sideA, sideB, sideC);

            // Assert
            Assert.Equal(expected, result);
        }