Exemple #1
0
        public async Task TestTestReporter_ReportsSucessfully()
        {
            //arrange
            IReportAgent reportAgent   = NSubstitute.Substitute.For <IReportAgent>();
            var          captureDevice = new TestCaptureDevice();
            SharpPcapInformationSource networkInformationSource = new SharpPcapInformationSource(captureDevice, 2000);
            SimpleRule simpleRule = new SimpleRule("FTP");
            Sensor     sensor     = new Sensor(networkInformationSource, simpleRule, reportAgent);

            //act
            sensor.Start();
            await TestPause();

            //assert
            reportAgent.ReceivedWithAnyArgs().ReportPacketCaptured(null);
        }
Exemple #2
0
 public Sensor(IInformationSource infoSource, IRule idsRule, IReportAgent reportAgent) : this(infoSource, idsRule)
 {
     this.reportAgent = reportAgent;
 }