Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }