Пример #1
0
 public FileLogWriter(IConfigContainer <IFileConfig> fileConfigContainer, IFileAnalyzer fileAnalyzer,
                      ILogMessageCreator logMessageCreator)
 {
     _fileConfigContainer = fileConfigContainer;
     _fileAnalyzer        = fileAnalyzer;
     _logMessageCreator   = logMessageCreator;
 }
Пример #2
0
        public void EnumerableCtorDoesNotThrowIfSequenceContainsNull(Type type)
        {
            FileType[] types = new FileType[] { MimeTypes.ELF, null, MimeTypes.DLL_EXE };

            IFileAnalyzer analyzer = type.EnumerableCtor(types);

            Assert.NotNull(analyzer);
        }
Пример #3
0
        public void DefaultConstructor(Type type)
        {
            IFileAnalyzer analyzer = type.DefaultCtor();

            //assertion here just to have
            Assert.NotNull(analyzer);

            analyzer.Insert(MimeTypes.ZIP);
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RpmPackageCreator"/> class.
        /// </summary>
        /// <param name="analyzer">
        /// An <see cref="IFileAnalyzer"/> used to analyze the files in this package and provides required
        /// meatata for the files.
        /// </param>
        public RpmPackageCreator(IFileAnalyzer analyzer)
        {
            if (analyzer == null)
            {
                throw new ArgumentNullException(nameof(analyzer));
            }

            this.analyzer = analyzer;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ArchiveBuilder"/> class.
        /// </summary>
        /// <param name="analyzer">
        /// A <see cref="IFileAnalyzer"/> which can extract item metadata.
        /// </param>
        public ArchiveBuilder(IFileAnalyzer analyzer)
        {
            if (analyzer == null)
            {
                throw new ArgumentNullException(nameof(analyzer));
            }

            this.fileAnayzer = analyzer;
        }
Пример #6
0
        /// <summary>
        /// Initialize new instance of <see cref="MoviebaseApp"/>.
        /// </summary>
        private MoviebaseApp()
        {
            _dal             = new MoviebaseDAL();
            _pathTransformer = new PathTransformer();

            _fileScanner   = new FileScanner();
            _fileAnalyzer  = new FileAnalyzer(new CompositeTitleProvider());
            _fileOrganizer = new FileOrganizer(new FolderCleaner(), _pathTransformer);

            _apiClient = new TMDbClient(GlobalSettings.Default.ApiKey);

            ReloadSettings();
        }
Пример #7
0
        public void EnumerableConstructor(Type type)
        {
            IFileAnalyzer analyzer = type.EnumerableCtor(MimeTypes.Types);

            //assertion here just to have
            Assert.NotNull(analyzer);
            Assert.Throws <ArgumentNullException>(() => type.EnumerableCtor(null));

            IFileAnalyzer emptyAnalyzer = type.EnumerableCtor(Enumerable.Empty <FileType>());

            Assert.NotNull(emptyAnalyzer);

            analyzer.Insert(MimeTypes.WORD);
        }
Пример #8
0
        public MovideoApp(IConfigReader configReader, IFileScanner fileScanner, IFileAnalyzer analyzer, IMovieDb db)
        {
            _fileScanner = fileScanner;
            _analyzer    = analyzer;
            _db          = db;

            ApiSettings apiSettings = configReader.GetApiSettings();

            if (apiSettings == null)
            {
                throw new ArgumentNullException("Impossibile proseguire. API non configurata.");
            }
            _apiClient = new TMDbClient(apiSettings.ApiKey)
            {
                DefaultCountry  = "IT",
                DefaultLanguage = "it"
            };
        }
Пример #9
0
        public static void Process(Func <OutputImpl, IFileAnalyzer> analyzerFactory, String source, String assemblyName, String filePath, OutputLevel outputLevel, Boolean expectedResult, String expectedOutput)
        {
            SemanticModel model        = PreparationHelper.Prepare(source, assemblyName);
            ConfigData    externalData = new ConfigData();

            using (TextWriter outputWriter = new StringWriter())
                using (TextWriter errorWriter = new StringWriter())
                {
                    OutputImpl    output       = new OutputImpl(outputWriter, errorWriter, outputLevel);
                    IFileAnalyzer analyzer     = analyzerFactory(output);
                    Boolean       actualResult = analyzer.Process(filePath, model.SyntaxTree, model, externalData);
                    Assert.AreEqual(expectedResult, actualResult);
                    String actualOutput = outputWriter.ToString();
                    Assert.AreEqual(expectedOutput, actualOutput);
                    String actualError = errorWriter.ToString();
                    Assert.AreEqual("", actualError);
                }
        }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CpioFileCreator"/> class.
 /// </summary>
 public CpioFileCreator()
 {
     this.fileAnayzer = new FileAnalyzer();
 }
 public PersistanceService(IFileAnalyzer fileAnalyzer)
 {
     _fileAnalyzer = fileAnalyzer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ArchiveBuilder"/> class.
 /// </summary>
 public ArchiveBuilder()
 {
     this.fileAnayzer = new FileAnalyzer();
 }