예제 #1
0
        public void ThrowArgumentNullException_WhenIFileReaderFileSystemWatcherFactoryIsNull()
        {
            // Arrange
            var commandParsingStrategy = new Mock<ICommandParsingStrategy>();
            var commandUtilizationStrategy = new Mock<ICommandUtilizationStrategy>();
            var logFilePathDiscoveryStrategy = new Mock<ILogFilePathDiscoveryStrategy>();
            var fileReaderAutoResetEventFactory = new Mock<IFileReaderAutoResetEventFactory>();
            IFileReaderFileSystemWatcherFactory fileReaderFileSystemWatcherFactory = null;
            var fileReaderInputProviderFactory = new Mock<IFileReaderInputProviderFactory>();

            // Act & Assert
            Assert.That(
                () => new LogFileReaderEngine(commandParsingStrategy.Object, commandUtilizationStrategy.Object, logFilePathDiscoveryStrategy.Object, fileReaderAutoResetEventFactory.Object, fileReaderFileSystemWatcherFactory, fileReaderInputProviderFactory.Object),
                Throws.InstanceOf<ArgumentNullException>().With.Message.Contains(nameof(IFileReaderFileSystemWatcherFactory)));
        }
예제 #2
0
        public LogFileReaderEngine(ICommandParsingStrategy commandParsingStrategy, ICommandUtilizationStrategy commandUtilizationStrategy, ILogFilePathDiscoveryStrategy logFilePathDiscoveryStrategy, IFileReaderAutoResetEventFactory fileReaderAutoResetEventFactory, IFileReaderFileSystemWatcherFactory fileReaderFileSystemWatcherFactory, IFileReaderInputProviderFactory fileReaderInputProviderFactory)
        {
            Guard.WhenArgument(commandParsingStrategy, nameof(ICommandParsingStrategy)).IsNull().Throw();
            Guard.WhenArgument(commandUtilizationStrategy, nameof(ICommandUtilizationStrategy)).IsNull().Throw();
            Guard.WhenArgument(logFilePathDiscoveryStrategy, nameof(ILogFilePathDiscoveryStrategy)).IsNull().Throw();
            Guard.WhenArgument(fileReaderAutoResetEventFactory, nameof(IFileReaderAutoResetEventFactory)).IsNull().Throw();
            Guard.WhenArgument(fileReaderFileSystemWatcherFactory, nameof(IFileReaderFileSystemWatcherFactory)).IsNull().Throw();
            Guard.WhenArgument(fileReaderInputProviderFactory, nameof(IFileReaderInputProviderFactory)).IsNull().Throw();

            this.commandParsingStrategy             = commandParsingStrategy;
            this.commandUtilizationStrategy         = commandUtilizationStrategy;
            this.logFilePathDiscoveryStrategy       = logFilePathDiscoveryStrategy;
            this.fileReaderAutoResetEventFactory    = fileReaderAutoResetEventFactory;
            this.fileReaderFileSystemWatcherFactory = fileReaderFileSystemWatcherFactory;
            this.fileReaderInputProviderFactory     = fileReaderInputProviderFactory;
        }
예제 #3
0
 public EnumeratingLogFileReaderEngine(ICommandParsingStrategy commandParsingStrategy, IForceCommandUtilizationStrategy forceCommandUtilizationStrategy, ILogFilePathDiscoveryStrategy logFilePathDiscoveryStrategy, IFileReaderAutoResetEventFactory fileReaderAutoResetEventFactory, IFileReaderFileSystemWatcherFactory fileReaderFileSystemWatcherFactory, IFileReaderInputProviderFactory fileReaderInputProviderFactory)
     : base(commandParsingStrategy, forceCommandUtilizationStrategy, logFilePathDiscoveryStrategy, fileReaderAutoResetEventFactory, fileReaderFileSystemWatcherFactory, fileReaderInputProviderFactory)
 {
     this.forceCommandUtilizationStrategy = forceCommandUtilizationStrategy;
 }