public void should_exclude_diagnostics_requests()
        {
            var filter = _registry.BuildGraph().Services.FindAllValues<IRequestHistoryCacheFilter>().First();

            var request = new CurrentRequest {Path = "/{0}/requests".ToFormat(DiagnosticUrlPolicy.DIAGNOSTICS_URL_ROOT)};
            filter.Exclude(request).ShouldBeTrue();
        }
Пример #2
0
        public void get_the_requested_mime_type_if_content_type_is_simple()
        {
            var request = new CurrentRequest(){
                ContentType = "text/xml"
            };

            request.RequestedMimeType().ShouldEqual("text/xml");
        }
Пример #3
0
        public void get_the_requested_mime_type_if_the_content_type_has_the_charset_as_well()
        {
            var request = new CurrentRequest()
            {
                ContentType = "text/xml; charset something or other"
            };

            request.RequestedMimeType().ShouldEqual("text/xml");
        }
Пример #4
0
        // TODO -- let's thin this down from CurrentRequest
        public void AddReport(IDebugReport report, CurrentRequest request)
        {
            if(_filters.Any(f => f.Exclude(request)))
            {
                return;
            }

            _reports.Enqueue(report);
            while (_reports.Count > _settings.MaxRequests)
            {
                _reports.Dequeue();
            }
        }
Пример #5
0
 public SiteResourceAttacher(ISparkViewEngine engine, CurrentRequest request)
 {
     _engine = engine;
     _request = request;
 }
Пример #6
0
 public void get_the_requested_mime_type_if_content_type_is_null()
 {
     var request = new CurrentRequest();
     request.RequestedMimeType().ShouldBeEmpty();
 }
Пример #7
0
 public bool Exclude(CurrentRequest request)
 {
     return _shouldExclude(request);
 }
Пример #8
0
 public bool Exclude(CurrentRequest request)
 {
     return (request.Path.IsNotEmpty() && request.Path.StartsWith("/" + DiagnosticUrlPolicy.DIAGNOSTICS_URL_ROOT));
 }
 public SiteResourceAttacher(ISparkViewEngine engine, IFubuRequest request)
 {
     _engine = engine;
     _request = request.Get<CurrentRequest>();
 }
 public void default_filter_excludes_diagnostics_requests()
 {
     var filter = new DiagnosticRequestHistoryCacheFilter();
     var request = new CurrentRequest { Path = "/{0}/requests".ToFormat(DiagnosticUrlPolicy.DIAGNOSTICS_URL_ROOT) };
     filter.Exclude(request).ShouldBeTrue();
 }