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); }
public void TestGetPositionResponseNotNull() { Sonda sonda = new Sonda(); sonda.GetPosition(); string returnTest = HttpContext.Current.Response.Output.ToString(); Assert.IsNotNull(returnTest); }