public void MatchDoesNotMatchWithNoDataFormat() { DataFormatCriteria criteria = new DataFormatCriteria("RSS"); RouteData routeData = new RouteData(); ActionFilterRegistryContext context = new ActionFilterRegistryContext(new System.Web.Mvc.ControllerContext(new FakeHttpContext("~/"), routeData, new FakeController()), new FakeActionDescriptor()); Assert.False(criteria.Match(context)); }
public void MatchMatchesPassedDataFormat() { DataFormatCriteria criteria = new DataFormatCriteria("RSS"); RouteData routeData = new RouteData(); routeData.Values.Add("dataFormat", "RSS"); ActionFilterRegistryContext context = new ActionFilterRegistryContext(new System.Web.Mvc.ControllerContext(new FakeHttpContext("~/"), routeData, new FakeController()), new FakeActionDescriptor()); Assert.True(criteria.Match(context)); }