public ConsoleLoggerTests()
 {
     _dateTimeWrap = Substitute.For<IDateTimeWrap>();
     _consoleWrap = Substitute.For<IConsoleWrap>();
     _consoleLogger = new ConsoleLoggerMock(_dateTimeWrap, _consoleWrap, true);
     _consoleLogger.Dispose();
 }
        public async Task StartTask_TestThatTaskWithCorrectDateTimeIsAdded(DateTime time1, string message, int taskId)
        {
            if (!Console.IsOutputRedirected)
            {
                _dateTimeWrap.UtcNow.Returns(new DateTimeWrap(time1));
                _consoleLogger = new ConsoleLoggerMock(_dateTimeWrap, _consoleWrap, true);

                // ReSharper disable once PossibleInvalidOperationException
                _consoleLogger.StartTask(taskId, message);

                ConsoleLoggerTask task;
                _consoleLogger.ConsoleTasksMock.TryRemove(taskId, out task);
                task.StartTime.Should().Be(time1);
                _consoleLogger.Dispose();
            }
        }