private void TestGetRulesHelper(CultureInfo info, string expectedRules) { Thread.CurrentThread.CurrentCulture = info; TraceRuleStore ruleStore = new TraceRuleStore(TESTPATH); Assert.AreEqual(expectedRules, ruleStore.RuleFile); }
public void TestGetObjects() { CultureInfo info = new CultureInfo("en-GB"); Thread.CurrentThread.CurrentCulture = info; string sExpectedObjects = "dummy objects"; TraceRuleStore ruleStore = new TraceRuleStore(TESTPATH); Assert.AreEqual(ruleStore.RetrieveObjects(), sExpectedObjects); info = new CultureInfo("fr-FR"); Thread.CurrentThread.CurrentCulture = info; //object files should be lang-indepedent so the same value should be returned regardless of culture Assert.AreEqual(ruleStore.RetrieveObjects(), sExpectedObjects); }
private void InitMailPolicy() { m_emailEngine = CreateEmailPolicyEngine(); if (m_emailEngine != null) { System.IO.FileInfo info = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location); m_ruleStore = new TraceRuleStore(info.Directory.FullName); m_auditor = new TraceEmailAuditor(); m_emailEngine.SetPolicyAuditor(m_auditor); m_emailEngine.SetRuleStore(m_ruleStore); m_auditor.AuditMail += new EventHandler<AuditEventArgs>(OnAuditMail); } }
public void TestConstructorInvalidPath_4() { //value in constructor should point to dir, not file TraceRuleStore rules = new TraceRuleStore(null); }
public void TestConstructorInvalidPath_3() { //value in constructor should point to dir, not file TraceRuleStore rules = new TraceRuleStore( TESTPATH + "\\policyobjects.xml" ); }
public void TestConstructorInvalidPath_2() { TraceRuleStore rules = new TraceRuleStore(@"p:\nonsense\directory\path"); }
public void TestConstructorInvalidPath_1() { TraceRuleStore rules = new TraceRuleStore("nonsense directory path"); }
public void TestConstructor() { TraceRuleStore rules = new TraceRuleStore( TESTPATH ); Assert.AreEqual(rules.RootPath, TESTPATH); }
/// <summary> /// This constructor will initialise the internal members /// </summary> public PolicySetVersionCache() { m_status = PolicySetVersionStatus.Enabled; System.IO.FileInfo info = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location); m_rules = new TraceRuleStore(info.Directory.FullName); }