public void GetNumbersShouldReturnTwoStrings()
 {
     var calc = new ConsoleCalculator();
     var stringArray = calc.GetNumbers("12+16");
     var expected = new string[] {"12","16"};
     CollectionAssert.AreEqual(stringArray, expected);
 }
 public void ShouldGetOperators()
 {
     var calc = new ConsoleCalculator();
     var op = calc.GetOperator("12-8");
     var expected = '-';
     Assert.AreEqual(expected, op);
 }
예제 #3
0
        //public static bool Operations { get; private set; }
        static void Main(string[] args)
        {
            ///user enters equation in 1+2 format

            Console.WriteLine("[X]>");

            string input = Console.ReadLine();
            var calculator = new ConsoleCalculator();
            var result = calculator.Calculate(input);

            Console.WriteLine("= " + result );

            Console.WriteLine("Press any key to exit.");
            Console.ReadLine();
        }