/// <summary>
 ///     Добавить источник в хранилище.
 /// </summary>
 /// <param name="source">Добавляемый источник.</param>
 public void AddSource(IndexSource source)
 {
     lock (this.syncObj)
     {
         this.storage.AddSource(source);
     }
 }
        public void CanAddSource()
        {
            var source = new IndexSource("fileName", false);
            this.storage.AddSource(source);

            IEnumerable<IndexSource> sources = this.storage.GetAllSources();
            Assert.IsNotNull(sources);
            Assert.AreEqual(1, sources.Count());
            Assert.AreEqual(source, sources.FirstOrDefault());
        }
        public void CanAddSeveralSources()
        {
            var source1 = new IndexSource("fileName1", false);
            var source2 = new IndexSource("fileName2", false);
            this.storage.AddSource(source1);
            this.storage.AddSource(source2);

            IEnumerable<IndexSource> sources = this.storage.GetAllSources();
            Assert.IsNotNull(sources);
            Assert.AreEqual(2, sources.Count());
            Assert.IsTrue(sources.Any(s => s == source1));
            Assert.IsTrue(sources.Any(s => s == source2));
        }
        public void CanAddSource()
        {
            string sourcePath = @"C:\dev\JetBraindexerTest\MyDir\";

            var indexSource = new IndexSource(string.Empty, false);

            this.mockSourceValidator
                .Setup(x => x.GetSourceByPath(It.IsAny<string>()))
                .Returns(indexSource);

            this.mockSourceStorage.Setup(x => x.AddSource(indexSource));

            this.service.AddSourceToIndexer(sourcePath);
        }
 /// <summary>
 ///     Добавить источник в хранилище.
 /// </summary>
 /// <param name="source">Добавляемый источник.</param>
 public void AddSource(IndexSource source)
 {
     this.sources.Add(source);
 }