示例#1
0
        public void Does_Not_Raise_Event_On_Info_When_Level_Is_Gt_Info(string message)
        {
            DiagnosticEventArgs e = null;

            var d = new DiagnosticFactory(this, DiagnosticLevel.Warning, (args) =>
            {
                e = args;
            });

            d.Info(message);

            Assert.Null(e);
        }
        public void Does_Not_Raise_Event_When_Level_Is_None(string message)
        {
            DiagnosticGeneratedEventArgs e = null;

            var d = new DiagnosticFactory(this, DiagnosticLevel.None, (args) =>
            {
                e = args;
            });

            d.Debug(message);
            d.Info(message);
            d.Warning(message);

            Assert.Null(e);
        }
示例#3
0
        public void Raises_Event_On_Info(string message)
        {
            DiagnosticEventArgs e = null;

            var d = new DiagnosticFactory(this, DiagnosticLevel.Info, (args) =>
            {
                e = args;
            });

            d.Info(message);

            Assert.Equal(message, e.Message);
            Assert.Equal(DiagnosticLevel.Info, e.Level);
            Assert.False(e.IncludesException);
            Assert.Null(e.Exception);
        }