public void BoundariesTest()
        {
            //Initialize test string
            string result = null;

            //Input boundary values for sides of triangle
            result = TriangleSolver.analyze(-1, 0, 1);
            //Testing the result against expected result
            NUnit.Framework.StringAssert.IsMatch("Triangle sides cannot be 0", result);
        }
        public void TriangleTest()
        {
            //Initialize test string
            string result = null;

            //Input one side bigger than the sum of the other two for sides of triangle
            result = TriangleSolver.analyze(6, 5, 12);
            //Testing the result against expected result
            NUnit.Framework.StringAssert.IsMatch("Triangle cannot be formed with the given sides", result);
        }
        public void NegativeEquilateralTest()
        {
            //Initialize test string
            string result = null;

            //Input equilateral but negative values for sides of triangle
            result = TriangleSolver.analyze(-11, -11, -11);
            //Testing the result against expected result
            NUnit.Framework.StringAssert.IsMatch("Triangle sides cannot be negative", result);
        }
        public void ScaleneTest()
        {
            //Initialize test string
            string result = null;

            //Input three different values for sides of triangle
            result = TriangleSolver.analyze(6, 9, 7);
            //Testing the result against expected result
            NUnit.Framework.StringAssert.IsMatch("Triangle is Scalene", result);
        }
        public void IsoscelesTest()
        {
            //Initialize test string
            string result = null;

            //Input two equal and one different values for sides of triangle
            result = TriangleSolver.analyze(5, 9, 5);
            //Testing the result against expected result
            NUnit.Framework.StringAssert.IsMatch("Triangle is Isosceles", result);
        }
        public void EquilateralTest()
        {
            //Initialize test string
            string result = null;

            //Input equal values for sides of triangle
            result = TriangleSolver.analyze(10, 10, 10);
            //Testing the result against expected result
            NUnit.Framework.StringAssert.IsMatch("Triangle is Equilateral", result);
        }
        public void AllSidesZeroTest()
        {
            //Initialize test string
            string result = null;

            //Input zero values for sides of triangle
            result = TriangleSolver.analyze(0, 0, 0);
            //Testing the result against expected result
            NUnit.Framework.StringAssert.IsMatch("Triangle sides cannot be 0", result);
        }
        public void Twoone()
        {
            //Arrange

            int s1 = 1, s2 = 1, s3 = 3;

            //Act

            String length = TriangleSolver.analyze(s1, s2, s3);


            //Assert
            Assert.AreEqual(length, "Invalid triangle");

            Console.WriteLine("Please check the result");
        }
        public void OneNegative()
        {
            //Arrange

            int s1 = -1, s2 = 3, s3 = 5;

            //Act

            String length = TriangleSolver.analyze(s1, s2, s3);


            //Assert
            Assert.AreEqual(length, "Negative triangle");

            Console.WriteLine("Please check the result");
        }
        public void Sides3and5and6Scalene()

        {
            //Arrange

            int s1 = 3, s2 = 5, s3 = 6;

            //Act

            String length = TriangleSolver.analyze(s1, s2, s3);

            //Assert

            Assert.AreEqual(length, "Triangle is Scalene");

            Console.WriteLine("Please check the result");
        }
        public void Sides5and5and5Equilateral()

        {
            //Arrange

            int s1 = 5, s2 = 5, s3 = 5;



            //Act

            String length = TriangleSolver.analyze(s1, s2, s3);

            //Assert

            Assert.AreEqual(length, "equvilateral");

            Console.WriteLine("Please check the result");
        }
        public void Sides5and4and4Isosceles()

        {
            //Arrange

            int s1 = 5, s2 = 4, s3 = 4;



            //Act

            String length = TriangleSolver.analyze(s1, s2, s3);

            //Assert

            Assert.AreEqual(length, "Triangle is Isosceles");

            Console.WriteLine("Please check the result");
        }
Example #13
0
 [TestMethod()]//Will check input number forming a Scalene Triangle
 public void analyzeScalenetriangleTest_IsTrue()
 {
     Assert.That(TriangleSolver.analyze(7, 12, 15), Is.EqualTo("This is a scalene triangle.\n"));
 }
Example #14
0
 [TestMethod()]//Will check input number forming an Isosceles Triangle
 public void analyzeIsoscelestriangleTest_IsTrue()
 {
     Assert.That(TriangleSolver.analyze(70, 70, 40), Is.EqualTo("This is an isosceles triangle.\n"));
 }
Example #15
0
 [TestMethod()]//Will check input number forming an Equilateral Triangle
 public void analyzeEquilateraltriangleTest_IsTrue()
 {
     Assert.That(TriangleSolver.analyze(25, 25, 25), Is.EqualTo("This is an equilateral triangle.\n"));
 }
Example #16
0
 [TestMethod()]//It will check user entered number and display message if any input is not forming a valid traingle
 public void analyzeTriangleValidityTest_NotValid()
 {
     Assert.That(TriangleSolver.analyze(2, 3, 8), Is.EqualTo("The triangle is not valid.\n"));
 }
 public void analyzeTriangleValidity()
 {
     Assert.That(TriangleSolver.analyze(2, 3, 8), Is.EqualTo("Triangle Not Valid"));
 }
 public void Test8()
 {
     Assert.AreEqual("Triangle Formed and Triangle is Isosceles", TriangleSolver.analyze(100, 100, 65));
 }
 public void Test7()
 {
     Assert.AreEqual("Triangle Formed and Triangle is Scalene", TriangleSolver.analyze(65, 43, 33));
 }
 public void Test5()
 {
     Assert.AreEqual("Triangle Formed and Triangle is Equilateral", TriangleSolver.analyze(1, 1, 1));
 }
Example #21
0
 [TestMethod()]// Will verify Third side is a valid number i.e. not negative,if it is then it will display an error
 public void sideThreeNumberValidityCheck_IsNegative()
 {
     Assert.That(TriangleSolver.analyze(7, 4, -9), Is.EqualTo("Side Three Invalid"));
 }
Example #22
0
 [TestMethod()]// Will verify first side is a valid number i.e. not negative,if it is then it will display an error
 public void sideOneNumberValidityCheck_IsNegative()
 {
     Assert.That(TriangleSolver.analyze(-5, 5, 6), Is.EqualTo("Side One Invalid"));
 }
Example #23
0
 [TestMethod()]// Will verify Second side is a valid number i.e. not negative,if it is then it will display an error
 public void sideTwoNumberValidityCheck_IsNegative()
 {
     Assert.That(TriangleSolver.analyze(8, -10, 2), Is.EqualTo("Side Two Invalid"));
 }
 public void Test1()
 {
     Assert.AreEqual("Triangle Formed and Triangle is Scalene", TriangleSolver.analyze(7, 10, 5));
 }
Example #25
0
 [TestMethod()]// Will verify all sides is a valid number i.e. not negative,if it is then it will display an error
 public void allSidesNumberValidityCheck_IsNegative()
 {
     Assert.That(TriangleSolver.analyze(-9, -8, -15), Is.EqualTo("All sides are negative"));
 }
 public void Test4()
 {
     Assert.AreEqual("Triangle Formed and Triangle is Scalene", TriangleSolver.analyze(5, 8, 3));
 }