Ejemplo n.º 1
0
        private void TestGetRulesHelper(CultureInfo info, string expectedRules)
        {
            Thread.CurrentThread.CurrentCulture = info;

            TraceRuleStore ruleStore = new TraceRuleStore(TESTPATH);

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

            Assert.AreEqual(rules.RootPath, TESTPATH);
        }
Ejemplo n.º 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);
 }