Beispiel #1
0
        public void MatchDoesNotMatchWithNoDataFormat()
        {
            DataFormatFilterCriteria criteria = new DataFormatFilterCriteria("RSS");

            RouteData routeData = new RouteData();

            FilterRegistryContext context = new FilterRegistryContext(new System.Web.Mvc.ControllerContext(new FakeHttpContext("~/"), routeData, new FakeController()), new FakeActionDescriptor());

            Assert.False(criteria.Match(context));
        }
Beispiel #2
0
        public void MatchMatchesPassedDataFormat()
        {
            DataFormatFilterCriteria criteria = new DataFormatFilterCriteria("RSS");

            RouteData routeData = new RouteData();

            routeData.Values.Add("dataFormat", "RSS");

            FilterRegistryContext context = new FilterRegistryContext(new System.Web.Mvc.ControllerContext(new FakeHttpContext("~/"), routeData, new FakeController()), new FakeActionDescriptor());

            Assert.True(criteria.Match(context));
        }