Inheritance: ISourceManager, IDisposable
        public void FindDestinationPile_WithRealPileCombined_ReturnsCorrectSetOfFiles()
        {
            var manager = new DefaultSourceManager(true, ".js", "testCompile", _sourceCompiler);
            var pile = GetWorkingPile(true);
            var compiler = new CompilerConfiguration();
            _sourceCompiler.CompileFile(Arg.Any<FileInfo>(), compiler).Returns(Task.Factory.StartNew(() => new CompileResult { Output = "Saved" }));
            manager.SetPileAsSource(pile, compiler).Wait();

            var dest = manager.FindDestinationPile();

            Assert.That(dest.FindFiles("global").Count(), Is.EqualTo(1));
            Assert.That(dest.FindFiles("global").Single().Name, Is.EqualTo("global.js"));
        }
 public void Init()
 {
     _sourceCompiler = Substitute.For<ISourceCompiler>();
     _manager = new DefaultSourceManager(false, ".js", "testCompile", _sourceCompiler);
 }
        public void SetPileSource_AddPile_CominationWorks()
        {
            var manager = new DefaultSourceManager(true, ".js", "testCompile", _sourceCompiler);
            var pile = GetWorkingPile(true);
            var compiler = new CompilerConfiguration();
            _sourceCompiler.CompileFile(Arg.Any<FileInfo>(), compiler).Returns(Task.Factory.StartNew(() => new CompileResult { Output = "Saved" }));

            manager.SetPileAsSource(pile, compiler).Wait();

            Assert.That(File.ReadAllText("testCompile/global.js"), Is.EqualTo("SavedSaved"));
        }