示例#1
0
        public void TotalTest()
        {
            const string ErrorMessage = "TestErrorMessage";
            const string WarningMessage = "TestErrorMessage";
            const string ExceptionMessage = "TestException";
            var exception = new Exception(ExceptionMessage);

            var instance = new SynchronizationContext();

            instance.AddError(ErrorMessage);
            instance.AddWarning(WarningMessage);
            instance.AddException(exception);

            Assert.AreEqual(ErrorMessage, instance.Errors.First());
            Assert.AreEqual(WarningMessage, instance.Warnings.First());
            Assert.AreEqual(ExceptionMessage, instance.Exceptions.First().Message);
        }