public void LoadFirewallRulesTest() { TestUtility.TestProlog(); string traceLogPath = Utility.GenerateProgramFilePath(Program.Config.WorkingDirectoryPath, ".log"); using (TraceLogger traceLogger = new TraceLogger(traceLogPath)) { FirewallInfoCollectorTest collector = new FirewallInfoCollectorTest(traceLogger); // long as no exception is thrown IEnumerable <INetFwRule> rules = collector.LoadFirewallRules(); Assert.IsNotNull(rules); } File.Delete(traceLogPath); TestUtility.TestEpilog(); }
public void CollectLogsTest() { TestUtility.TestProlog(); string traceLogPath = Utility.GenerateProgramFilePath(Program.Config.WorkingDirectoryPath, ".log"); using (TraceLogger traceLogger = new TraceLogger(traceLogPath)) { FirewallInfoCollectorTest collector = new FirewallInfoCollectorTest(traceLogger); collector.CollectLogs(); Assert.AreEqual(1, collector.CollectionResult.Count); Assert.AreEqual(1, collector.GeneratedLogs.Count); string outputFilePath = Program.Config.WorkingDirectoryPath + "\\Firewall.xml"; Assert.IsTrue(File.Exists(outputFilePath)); File.Delete(outputFilePath); } File.Delete(traceLogPath); TestUtility.TestEpilog(); }