public void ddPCAPParser_MaliciousPCAPArguments() { var pParser = new PCAPParser(); Assert.IsTrue(pParser.Name == "PCAP"); var path = Path.Combine(AppContext.BaseDirectory, @"..\..\..\Samples\pcap\malicious_sample1.pcap"); var result = pParser.IsParseable(null, path); Assert.IsTrue(result); pParser.LoadModel(); var modelRun = pParser.RunModel(null, path); Assert.IsNotNull(modelRun); Assert.IsFalse(modelRun.Prediction); Assert.IsTrue(modelRun.Probability == 0.5f); }
public void ddPCAPParser_BenginPCAPArguments() { var pParser = new PCAPParser(); Assert.IsTrue(pParser.Name == "PCAP"); var path = Path.Combine(AppContext.BaseDirectory, @"..\..\..\Samples\pcap\benign_pcap.pcap"); var result = pParser.IsParseable(null, path); Assert.IsTrue(result); pParser.LoadModel(); var modelRun = pParser.RunModel(null, path); Assert.IsNotNull(modelRun); Assert.IsFalse(modelRun.Prediction); Assert.IsTrue(Math.Abs(modelRun.Probability - 0.5f) < 0.01); }