コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }