Ejemplo n.º 1
0
        public void XmlToJasonWarningTest()
        {
            //Arrange
            string expected = "Bad Xml format";
            string input    = ("<foo>hello</bar>");

            //Act
            WebServiceLemonway obj    = new WebServiceLemonway();
            string             actuel = obj.XmlToJson(input);

            //Assert
            Assert.AreEqual(expected, actuel);
        }
Ejemplo n.º 2
0
        public void XmlToJasonTest()
        {
            //Arrange
            string expected = "{\"foo\":\"bar\"}";
            string input    = ("<foo>bar</foo>");

            //Act
            WebServiceLemonway obj    = new WebServiceLemonway();
            string             actuel = obj.XmlToJson(input);

            //Assert
            Assert.AreEqual(expected, actuel);
        }
Ejemplo n.º 3
0
        public void FibonacciTest()
        {
            //Arrange
            long expected = 8;
            int  input    = 6;

            //Act
            WebServiceLemonway obj = new WebServiceLemonway();
            long actuel            = obj.Fibonacci(input);

            //Assert
            Assert.AreEqual(expected, actuel);
        }
        public void FibonacciTest5()
        {
            //Arrange
            string expected = "-1";
            long   input    = 101;

            //Act
            WebServiceLemonway obj    = new WebServiceLemonway();
            string             actuel = obj.Fibonacci(input);

            //Assert
            Assert.AreEqual(expected, actuel);
        }
        public void FibonacciTest3()
        {
            //Arrange
            string expected = "218922995834555169026";
            long   input    = 99;

            //Act
            WebServiceLemonway obj    = new WebServiceLemonway();
            string             actuel = obj.Fibonacci(input);

            //Assert
            Assert.AreEqual(expected, actuel);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            WebServiceLemonway obj = new WebServiceLemonway();

            Console.WriteLine("Enter number:");
            int    value1 = Convert.ToInt32(Console.ReadLine());
            string result = obj.Fibonacci(value1).ToString();

            Console.WriteLine("Fibonacci number is:" + result);
            Console.WriteLine("Enter XML:");
            string value2  = Console.ReadLine();
            string result2 = obj.XmlToJson(value2);

            Console.WriteLine("The Jason format is:" + result2);
            Console.ReadKey();
        }