Exemplo n.º 1
0
        public void ThrowArgumentNullException_WhenIFileReaderInputProviderFactoryIsNull()
        {
            // Arrange
            var commandParsingStrategy = new Mock<ICommandParsingStrategy>();
            var commandUtilizationStrategy = new Mock<ICommandUtilizationStrategy>();
            var logFilePathDiscoveryStrategy = new Mock<ILogFilePathDiscoveryStrategy>();
            var fileReaderAutoResetEventFactory = new Mock<IFileReaderAutoResetEventFactory>();
            var fileReaderFileSystemWatcherFactory = new Mock<IFileReaderFileSystemWatcherFactory>();
            IFileReaderInputProviderFactory fileReaderInputProviderFactory = null;

            // Act & Assert
            Assert.That(
                () => new LogFileReaderEngine(commandParsingStrategy.Object, commandUtilizationStrategy.Object, logFilePathDiscoveryStrategy.Object, fileReaderAutoResetEventFactory.Object, fileReaderFileSystemWatcherFactory.Object, fileReaderInputProviderFactory),
                Throws.InstanceOf<ArgumentNullException>().With.Message.Contains(nameof(IFileReaderInputProviderFactory)));
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }