Пример #1
0
        public LogFilePathDiscoveryStrategy(IEnvironmentFolderPathProvider environmentFolderPathProvider, IDirectoryFilesProvider directoryFilesProvider)
        {
            Guard.WhenArgument(environmentFolderPathProvider, nameof(IEnvironmentFolderPathProvider)).IsNull().Throw();
            Guard.WhenArgument(directoryFilesProvider, nameof(IDirectoryFilesProvider)).IsNull().Throw();

            this.environmentFolderPathProvider = environmentFolderPathProvider;
            this.directoryFilesProvider        = directoryFilesProvider;
        }
Пример #2
0
        public void ThrowArgumentNullException_WhenIDirectoryFilesProviderParameterIsNull()
        {
            // Arrange
            var environmentFolderPathProvider = new Mock <IEnvironmentFolderPathProvider>();
            IDirectoryFilesProvider directoryFilesProvider = null;

            // Act & Assert
            Assert.That(
                () => new LogFilePathDiscoveryStrategy(environmentFolderPathProvider.Object, directoryFilesProvider),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(IDirectoryFilesProvider)));
        }