예제 #1
0
        public void should_allow_reports_per_default()
        {
            var report = new ErrorReportDTO("aa", new ExceptionDTO(new Exception()), new ContextCollectionDTO[0]);

            var sut = new ReportFilterContext(report);

            sut.CanSubmitReport.Should().BeTrue();
        }
예제 #2
0
        public void the_report_should_be_assign_to_the_property_so_that_we_can_filter_on_it()
        {
            var report = new ErrorReportDTO("aa", new ExceptionDTO(new Exception()), new ContextCollectionDTO[0]);

            var sut = new ReportFilterContext(report);

            sut.Report.Should().BeSameAs(report);
        }
        private static ContextCollectionDTO FindUrl(ReportFilterContext context)
        {
            string url;

            return((
                       from collection in context.Report.ContextCollections
                       from property in collection.Properties
                       where property.Key == "Url" && property.Value.Contains("/receiver/report/")
                       select collection
                       ).FirstOrDefault());
        }
        public void Invoke(ReportFilterContext context)
        {
            var collection = FindUrl(context);

            if (collection == null)
            {
                return;
            }

            var property = collection.Properties.FirstOrDefault(x => x.Key == "Url");
            var pos      = property.Value.LastIndexOf('/');

            if (pos != -1)
            {
                collection.Properties["Url"] = property.Value.Remove(pos);
            }
        }
예제 #5
0
 public void Invoke(ReportFilterContext context)
 {
     context.CanSubmitReport = Answer;
 }