Esempio n. 1
0
        public void AddToLog_AddsToLog()
        {
            // ARRANGE
            var          statusTracker = new BBS.Libraries.Logging.StatusTracker();
            const string message       = "this is a test message!";

            // ACT
            statusTracker.AddToLog(message);

            // ASSERT
            Assert.That(statusTracker.Log, Contains.Substring(message));
        }
Esempio n. 2
0
        public void AddErrorToLog_AddsToLog()
        {
            // ARRANGE
            var          statusTracker = new BBS.Libraries.Logging.StatusTracker();
            const string message       = "Out of memory";
            var          error         = new OutOfMemoryException(message);

            // ACT
            statusTracker.AddToLog(error);

            // ASSERT
            Assert.That(statusTracker.Log, Contains.Substring($"EXCEPTION: "));
            Assert.That(statusTracker.Log, Contains.Substring(message));
        }