예제 #1
0
        private void TestGetRulesHelper(CultureInfo info, string expectedRules)
        {
            Thread.CurrentThread.CurrentCulture = info;

            TraceRuleStore ruleStore = new TraceRuleStore(TESTPATH);

            Assert.AreEqual(expectedRules, ruleStore.RuleFile);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
 public void TestConstructorInvalidPath_4()
 {
     //value in constructor should point to dir, not file
     TraceRuleStore rules = new TraceRuleStore(null);
 }
예제 #5
0
 public void TestConstructorInvalidPath_3()
 {
     //value in constructor should point to dir, not file
     TraceRuleStore rules = new TraceRuleStore( TESTPATH + "\\policyobjects.xml" );
 }
예제 #6
0
 public void TestConstructorInvalidPath_2()
 {
     TraceRuleStore rules = new TraceRuleStore(@"p:\nonsense\directory\path");
 }
예제 #7
0
 public void TestConstructorInvalidPath_1()
 {
     TraceRuleStore rules = new TraceRuleStore("nonsense directory path");
 }
예제 #8
0
        public void TestConstructor()
        {
            TraceRuleStore rules = new TraceRuleStore( TESTPATH );

            Assert.AreEqual(rules.RootPath, TESTPATH);
        }
예제 #9
0
 /// <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);
 }