Exemplo n.º 1
0
        public void calculatenewsystemtest(int number, int numbersystem, string result)
        {
            NewNumberSysteminterpreter test1 = new NewNumberSysteminterpreter(number, numbersystem);
            string newstr = test1.calculatenewsystem();

            Assert.AreEqual(result, newstr);
        }
Exemplo n.º 2
0
        public void ReverseAnswerTest(string input, string output)
        {
            NewNumberSysteminterpreter test2 = new NewNumberSysteminterpreter(10, 10);
            string temp = test2.ReverseAnswer(input);

            Assert.AreEqual(temp, output);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            ArgumentsCheck test  = new ArgumentsCheck(args);
            Boolean        check = test.validate();

            if (true == check)
            {
                int decimalnumber = Convert.ToInt32(args[0]);
                int system        = Convert.ToInt32(args[1]);
                NewNumberSysteminterpreter number = new NewNumberSysteminterpreter(decimalnumber, system);
                string answer = number.calculatenewsystem();
                answer = number.ReverseAnswer(answer);
                Console.WriteLine(answer);
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("check the correctness of the input");
                Console.ReadLine();
            }
        }