public void OnActionExecuted_ShouldAffectResultForNullQueryStringVariableValue() { jsonForQueryStringAttribute = new JsonForQueryStringAttribute("foo", null); jsonForQueryStringAttribute.OnActionExecuted(filterContext, httpRequestBase); Assert.That(((JsonResult)filterContext.Result).Data, Is.True); }
public void SetUp() { defaultActionResult = new ViewResult(); filterContext = new ActionExecutedContext { Result = defaultActionResult, Controller = new TempController { ViewData = new ViewDataDictionary(true) } }; httpRequestBase = Substitute.For<HttpRequestBase>(); httpRequestBase.QueryString.Returns(new NameValueCollection {{"foo", "bar"}}); jsonForQueryStringAttribute = new JsonForQueryStringAttribute("foo", "bar"); }