Пример #1
0
        public void TestConstructorSetsExpectedName()
        {
            var expectedName = GetRandom.String(10);

            using (var newListener = new LogglyTraceListener(expectedName, this._mockLogFormatter, this._mockLogger))
            {
                newListener.Name.Should().Be(expectedName);
            }
        }
Пример #2
0
        public void TestConstructorSetsExpectedLogger()
        {
            var expectedLogger = Substitute.For <ILogger>();

            using (var newListener = new LogglyTraceListener(GetRandom.String(10), this._mockLogFormatter, expectedLogger))
            {
                newListener.Logger.Should().BeSameAs(expectedLogger);
            }
        }
Пример #3
0
        public void CleanupTest()
        {
            this._mockLogFormatter = null;
            this._mockLogger       = null;

            if (this._targetListener != null)
            {
                this._targetListener.Dispose();
                this._targetListener = null;
            }
        }
Пример #4
0
        protected virtual void Dispose(bool isDisposing)
        {
            if (isDisposing)
            {
                if (!this._isDisposed && this._targetListener != null)
                {
                    this._targetListener.Dispose();
                    this._targetListener = null;
                }
            }

            this._isDisposed = true;
        }
Пример #5
0
 public void InitializeTest()
 {
     this._mockLogFormatter = Substitute.For <ILogFormatter>();
     this._mockLogger       = Substitute.For <ILogger>();
     this._targetListener   = new LogglyTraceListener(GetRandom.String(10), this._mockLogFormatter, this._mockLogger);
 }