Beispiel #1
0
        public void WriteToConsoleTest()
        {
            MsLogger logger = new MsLogger();

            logger.Fatal("Fatal message");
            logger.Error("Error message");
            logger.Info("Info message");
            logger.Debug("Debug message");
        }
Beispiel #2
0
        public void WriteToFileTest()
        {
            MsLogger logger = new MsLogger();

            string filePath = logger.LogFilePath;

            if (File.Exists(filePath))
            {
                File.Delete(filePath);
            }

            string message = "This is Test Message";

            logger.Fatal(message);
            logger.Shutdown();
            Assert.IsTrue(File.ReadAllText(filePath).Contains(message));
        }