/// <summary> /// Main method that executes on Load /// </summary> /// <param name="args"></param> static void Main(string[] args) { int a; int b; int c; string input; do { Console.WriteLine("\n1. Enter Triangle Dimensions: " + "\n" + "2. Exit" + "\n"); input = Console.ReadLine(); try { if (input == "1") { Console.WriteLine("Enter 3 Numbers" + "\n"); Console.WriteLine("Enter First Number: "); a = int.Parse(Console.ReadLine()); Console.WriteLine("Enter Second Number "); b = int.Parse(Console.ReadLine()); Console.WriteLine("Enter Third Number "); c = int.Parse(Console.ReadLine()); string answer = TriangleSolver.Analyze(a, b, c); Console.WriteLine(answer); } if (input == "2") { break; } } catch (Exception) { Console.WriteLine("The values entered are not valid"); } } while (true); }
public void CheckNegativeValues() { String Answer = TriangleSolver.Analyze(2, -5, 2); Assert.AreEqual("Negative values cannot be computed", Answer); }
public void CheckValuesUpperLimit() { String Answer = TriangleSolver.Analyze(10001, 5, 2); Assert.AreEqual("Values cannot exceed 1000", Answer); }
public void CheckValidTriangle() { String Answer = TriangleSolver.Analyze(0, 0, 0); Assert.AreEqual("This does not form a triangle", Answer); }
public void CheckScalene() { String Answer = TriangleSolver.Analyze(1, 2, 3); Assert.AreEqual("Your Triangle is Scalene", Answer); }
public void CheckIsoceles() { String Answer = TriangleSolver.Analyze(1, 2, 1); Assert.AreEqual("Your Triangle is Isoceles", Answer); }
public void CheckEqualateral() { String Answer = TriangleSolver.Analyze(2, 2, 2); Assert.AreEqual("Your Triangle is Equilateral", Answer); }