public void ScriptRunnerCorrectlyConvertsMultipleScripts([Frozen] IScriptEngine engine, ScriptRunner sut, InlineScriptSource[] sources)
        {
            var scriptBlock = new ScriptBlock(sources);

            var expected = sources.Select(s => new Script(s.Name, s.ScriptText));

            sut.RunScripts(scriptBlock);

            Mock.Get(engine).Verify(x => x.Execute(It.Is<IEnumerable<Script>>(actual => actual.EnumerableEquals(expected))));
        }
        public void ScriptRunnerCorrectlyConvertsInlineScript(string scriptName, string scriptSource, [Frozen] IScriptEngine engine, ScriptRunner sut)
        {
            var scriptBlock = ScriptBlock.Empty.AppendScript(new InlineScriptSource(scriptName, scriptSource));

            var expected = new[]
            {
                new Script(scriptName, scriptSource)
            };

            sut.RunScripts(scriptBlock);

            Mock.Get(engine).Verify(x => x.Execute(It.Is<IEnumerable<Script>>(actual => actual.EnumerableEquals(expected))));
        }
 public void ScriptRunnerHasCorrectProperties()
 {
     var sut = new ScriptRunner();
     Assert.IsType<ScriptEngineProxy>(sut.ScriptEngine);
     Assert.IsType<FileOrResourceScriptLoader>(sut.ScriptLoader);
 }