Example #1
0
        public void TestGetPosition()
        {
            List <Object> position = new List <Object>
            {
                new
                {
                    x = "0"
                },

                new
                {
                    y = "0"
                },

                new
                {
                    face = "D"
                }
            };

            Object expectedReturnJSON = new
            {
                position
            };

            string expectedReturn = (new JavaScriptSerializer()).Serialize(expectedReturnJSON);

            Sonda sonda = new Sonda();

            sonda.GetPosition();

            string returnTest = HttpContext.Current.Response.Output.ToString();

            Assert.AreEqual(expectedReturn, returnTest);
        }
Example #2
0
        public void TestGetPositionResponseNotNull()
        {
            Sonda sonda = new Sonda();

            sonda.GetPosition();

            string returnTest = HttpContext.Current.Response.Output.ToString();

            Assert.IsNotNull(returnTest);
        }