コード例 #1
0
ファイル: Form1.cs プロジェクト: jcbaar/Muses.Slf
        public Form1()
        {
            InitializeComponent();

            var fa = ConcreteLoader.LoadFactories();

            foreach (var f in fa)
            {
                factories.Items.Add(f);
            }
        }
コード例 #2
0
        public void ConcreteLoader_LoadFactories_ReturnsCorrectFactories()
        {
            // Arrange.
            List <ILoggerFactory> factories;

            // Ideally I would have split up these tests but since they are order dependent
            // and MSTest V2 does not support ordered testing this will have to suffice...
            // Act
            factories = ConcreteLoader.LoadFactories(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "bull");

            // Assert
            Assert.AreEqual(1, factories.Count, "Expected one logger factory to be returned.");
            Assert.IsNotNull(factories.Where(f => f.Name.Equals("NOP")), "Expected the NOP logger factory to be returned.");

            // Act
            factories = ConcreteLoader.LoadFactories();

            // Assert
            Assert.IsTrue(factories.Count >= 2, "Expected at least 2 logger factories to be returned.");
            Assert.IsNotNull(factories.Where(f => f.Name.Equals("NLog")), "The NLog logger factory was not discovered.");
            Assert.IsNotNull(factories.Where(f => f.Name.Equals("log4net")), "The log4net logger factory was not discovered.");
        }
コード例 #3
0
 public void NLog_EventAppender_IsCalledOk()
 {
     Helper_EventCallback_IsCalledOk(ConcreteLoader.LoadFactories().Single(f => f.Name.Equals("NLog")));
 }
コード例 #4
0
 public void NLog_RegisterUnregisterCallback_IsOk()
 {
     Helper_RegisterUnregisterCallback_IsOk(ConcreteLoader.LoadFactories().Single(f => f.Name.Equals("NLog")));
 }