public IPackageScript CreatePackageInitializeScript(IPackage package, string packageInstallDirectory)
        {
            FakePackageScript script = FakeInitializeScripts[0];

            FakeInitializeScripts.RemoveAt(0);
            return(script);
        }
        public FakePackageScript AddFakeInitializationScript()
        {
            var script = new FakePackageScript();

            FakeInitializeScripts.Add(script);
            return(script);
        }
 public IPackageScript CreatePackageInstallScript(IPackage package, string packageInstallDirectory)
 {
     PackageInstallDirectoriesPassed.Add(packageInstallDirectory);
     var script = new FakePackageScript();
     script.Package = package;
     script.ExistsReturnValue = ScriptFileExistsReturnValue;
     FakePackageInstallScriptsCreated.Add(script);
     return script;
 }
Esempio n. 4
0
        public IPackageScript CreatePackageInstallScript(IPackage package, string packageInstallDirectory)
        {
            PackageInstallDirectoriesPassed.Add(packageInstallDirectory);
            var script = new FakePackageScript();

            script.Package           = package;
            script.ExistsReturnValue = ScriptFileExistsReturnValue;
            FakePackageInstallScriptsCreated.Add(script);
            return(script);
        }
 public FakePackageScript AddFakeInitializationScript()
 {
     var script = new FakePackageScript();
     FakeInitializeScripts.Add(script);
     return script;
 }
        public void Run_PackageScriptPassed_RunsScriptUsingCmdletAsSession()
        {
            CreateCmdlet();

            var script = new FakePackageScript();
            cmdlet.Run(script);

            IPackageScriptSession session = script.SessionPassedToRun;

            Assert.AreEqual(cmdlet, session);
        }
        public void Run_PackageScriptDoesNotExist_ScriptIsNotRun()
        {
            CreateCmdlet();

            var script = new FakePackageScript();
            script.ExistsReturnValue = false;
            cmdlet.Run(script);

            bool run = script.IsRun;

            Assert.IsFalse(run);
        }