public void UserShowIndexFailure() { // bad test, only guaranteed to work for initial state Controllers.IndicesController indicesController = new Controllers.IndicesController(); IHttpActionResult result = indicesController.GetIndexWithoutAuthorization("A", "SPY"); Assert.IsInstanceOfType(result, typeof(NotFoundResult)); }
public void UserShowIndexSuccess() { Controllers.IndicesController indicesController = new Controllers.IndicesController(); IHttpActionResult result = indicesController.GetIndexWithoutAuthorization("A", "DIA"); Assert.IsInstanceOfType(result, typeof(JsonResult <ExpandoObject>)); dynamic obj = ((JsonResult <ExpandoObject>)result).Content; Assert.AreEqual("DIA", obj.Ticker); }