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))); }
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; }
public EnumeratingLogFileReaderEngine(ICommandParsingStrategy commandParsingStrategy, IForceCommandUtilizationStrategy forceCommandUtilizationStrategy, ILogFilePathDiscoveryStrategy logFilePathDiscoveryStrategy, IFileReaderAutoResetEventFactory fileReaderAutoResetEventFactory, IFileReaderFileSystemWatcherFactory fileReaderFileSystemWatcherFactory, IFileReaderInputProviderFactory fileReaderInputProviderFactory) : base(commandParsingStrategy, forceCommandUtilizationStrategy, logFilePathDiscoveryStrategy, fileReaderAutoResetEventFactory, fileReaderFileSystemWatcherFactory, fileReaderInputProviderFactory) { this.forceCommandUtilizationStrategy = forceCommandUtilizationStrategy; }