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); }
public Sensor(IInformationSource infoSource, IRule idsRule, IReportAgent reportAgent) : this(infoSource, idsRule) { this.reportAgent = reportAgent; }