Ejemplo n.º 1
0
        public void should_allow_upload_if_all_of_the_filters_says_yes()
        {
            var sut    = new ReportFilterDispatcher();
            var report = Substitute.For <ErrorReportDTO>();

            sut.Add(new Filter {
                Answer = true
            });
            sut.Add(new Filter {
                Answer = true
            });
            sut.Add(new Filter {
                Answer = true
            });

            var actual = sut.CanUploadReport(report);

            actual.Should().BeTrue();
        }
Ejemplo n.º 2
0
        public void should_block_if_one_of_the_filters_says_no()
        {
            var sut    = new ReportFilterDispatcher();
            var report = Substitute.For <ErrorReportDTO>();

            sut.Add(new Filter {
                Answer = true
            });
            sut.Add(new Filter {
                Answer = false
            });
            sut.Add(new Filter {
                Answer = true
            });

            var actual = sut.CanUploadReport(report);

            actual.Should().BeFalse();
        }