public void TestConstructorSetsExpectedName() { var expectedName = GetRandom.String(10); using (var newListener = new LogglyTraceListener(expectedName, this._mockLogFormatter, this._mockLogger)) { newListener.Name.Should().Be(expectedName); } }
public void TestConstructorSetsExpectedLogger() { var expectedLogger = Substitute.For <ILogger>(); using (var newListener = new LogglyTraceListener(GetRandom.String(10), this._mockLogFormatter, expectedLogger)) { newListener.Logger.Should().BeSameAs(expectedLogger); } }
public void CleanupTest() { this._mockLogFormatter = null; this._mockLogger = null; if (this._targetListener != null) { this._targetListener.Dispose(); this._targetListener = null; } }
protected virtual void Dispose(bool isDisposing) { if (isDisposing) { if (!this._isDisposed && this._targetListener != null) { this._targetListener.Dispose(); this._targetListener = null; } } this._isDisposed = true; }
public void InitializeTest() { this._mockLogFormatter = Substitute.For <ILogFormatter>(); this._mockLogger = Substitute.For <ILogger>(); this._targetListener = new LogglyTraceListener(GetRandom.String(10), this._mockLogFormatter, this._mockLogger); }