Пример #1
0
        public void SetUp()
        {
            ConfigManager.GetInstance().LoadFile("../../test_files/logger.xml");

            logger = new MBRLogger(LogManager.CreateLogger("MyLoggerNamespace"));
            al     = new AssemblyLoader(new string[] { UnitTestHelper.REFPATH }, logger);
        }
Пример #2
0
        public void SetUp()
        {
            ConfigManager.GetInstance().LoadFile("../../test_files/logger.xml");

            logger    = LogManager.CreateLogger("MyLoggerNamespace");
            mbrLogger = new MBRLogger(logger);
        }
Пример #3
0
        public void SetUp()
        {
            ConfigManager.GetInstance().LoadFile("../../test_files/logger.xml");

            mbrLogger = new MBRLogger(LogManager.CreateLogger("MyLoggerNamespace"));
            xpr       = new XPathResolver();
        }
Пример #4
0
        public void TestConstructor2()
        {
            MBRLogger logger = new MBRLogger(LogManager.CreateLogger("MyLoggerNamespace"));

            sdc = new SlashDocCache(logger);
            Assert.IsTrue(object.ReferenceEquals(UnitTestHelper.GetPrivateField(sdc, "logger"), logger),
                          "Wrong constructor implementation");
        }
Пример #5
0
        public void TestAddSlashDocFiles()
        {
            MBRLogger logger = new MBRLogger(LogManager.CreateLogger("MyLoggerNamespace"));

            sdc = new SlashDocCache(logger);

            sdc.AddSlashDocFiles(
                new string[] { UnitTestHelper.MOCKXMLPATH, UnitTestHelper.MOCKXMLPATH });

            Hashtable tab = (Hashtable)UnitTestHelper.GetPrivateField(sdc, "docs");

            Assert.AreEqual(tab.Count, 53, "Wrong AddSlashDocFile implementation.");
        }
Пример #6
0
        public void TestAddSlashDocFile1()
        {
            MBRLogger logger = new MBRLogger(LogManager.CreateLogger("MyLoggerNamespace"));

            sdc = new SlashDocCache(logger);

            sdc.AddSlashDocFile("../../noSuch/skunk.xml");

            //Check a few entries in the hashtable
            Hashtable tab = (Hashtable)UnitTestHelper.GetPrivateField(sdc, "docs");

            Assert.AreEqual(tab.Count, 0, "Wrong AddSlashDocFile implementation.");
        }
Пример #7
0
        public void TestAddSlashDocFile()
        {
            MBRLogger logger = new MBRLogger(LogManager.CreateLogger("MyLoggerNamespace"));

            sdc = new SlashDocCache(logger);

            sdc.AddSlashDocFile(UnitTestHelper.MOCKXMLPATH);

            //Check a few entries in the hashtable
            Hashtable tab = (Hashtable)UnitTestHelper.GetPrivateField(sdc, "docs");

            Assert.AreEqual(tab.Count, 53, "Wrong AddSlashDocFile implementation.");
            Assert.IsTrue(tab.ContainsKey("M:MockLibrary.Nested.ClassC.ClassD.#ctor(System.Int32)"),
                          "Wrong AddSlashDocFile implementation.");
            Assert.IsTrue(tab.ContainsKey("M:MockLibrary.WakeMeUp.AlarmRang(System.Object,System.EventArgs)"),
                          "Wrong AddSlashDocFile implementation.");
            Assert.IsTrue(tab.ContainsKey("E:MockLibrary.WakeMeUp.Alarm"),
                          "Wrong AddSlashDocFile implementation.");
        }
Пример #8
0
 /// <summary>
 /// <para>Creates a new instance of AssemblyLoader with the given set of custom paths
 /// where to search the desired assembly and the given MBRLogger instance used to log infos,
 /// warnings or errors. referencePaths can be null indicating that no custom paths are searched.</para>
 /// </summary>
 /// <param name="logger">MBRLogger instance used to log infos, warnings or errors</param>
 /// <param name="referencePaths">set of custom paths where to search the dependent assemblies</param>
 /// <exception cref="ArgumentNullException">if logger is null</exception>
 /// <exception cref="ArgumentException">If referencePaths contain null or empty elements.</exception>
 public AssemblyLoader(string[] referencePaths, MBRLogger logger) : this(referencePaths)
 {
     Helper.ValidateNotNull(logger, "logger");
     this.logger = logger;
 }
Пример #9
0
 /// <summary>
 /// <para>Creates a new instance of SlashDocCache with the given MBRLogger instance.</para>
 /// </summary>
 /// <param name="logger">the MBRLogger instance used to log infos, warnings or errors.</param>
 /// <exception cref="ArgumentNullException">if logger is null.</exception>
 public SlashDocCache(MBRLogger logger)
 {
     Helper.ValidateNotNull(logger, "logger");
     this.logger = logger;
 }
Пример #10
0
 public void TearDown()
 {
     al     = null;
     logger = null;
     ConfigManager.GetInstance().Clear(false);
 }
Пример #11
0
 public void TestConstructorFail1()
 {
     mbrLogger = new MBRLogger(null);
 }
Пример #12
0
 /// <summary>
 /// <para>Creates a new instance of XPathResolver with the given MBRLogger instance.</para>
 /// </summary>
 /// <param name="logger">the MBRLogger instance used to log infos, warnings or errors.</param>
 /// <exception cref="ArgumentNullException">if logger is null.</exception>
 public XPathResolver(MBRLogger logger)
 {
     Helper.ValidateNotNull(logger, "logger");
     this.logger = logger;
 }