Browse Source

Check PowerShell scripts exist before attempting to run them.

pull/15/head
Matt Ward 15 years ago
parent
commit
a3b896b2e6
  1. 1
      src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj
  2. 16
      src/AddIns/Misc/PackageManagement/Project/Src/Scripting/IPackageScriptFileName.cs
  3. 2
      src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageInitializeScript.cs
  4. 2
      src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageInstallScript.cs
  5. 17
      src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageScript.cs
  6. 2
      src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageScriptFileName.cs
  7. 2
      src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageUninstallScript.cs
  8. 1
      src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj
  9. 41
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageScriptFileName.cs
  10. 2
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePowerShellSession.cs
  11. 65
      src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageInitializeScriptTests.cs
  12. 39
      src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageInstallScriptTests.cs

1
src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj

@ -170,6 +170,7 @@
<Compile Include="Src\ProcessPackageAction.cs" /> <Compile Include="Src\ProcessPackageAction.cs" />
<Compile Include="Src\Scripting\IPackageScript.cs" /> <Compile Include="Src\Scripting\IPackageScript.cs" />
<Compile Include="Src\Scripting\IPackageScriptFactory.cs" /> <Compile Include="Src\Scripting\IPackageScriptFactory.cs" />
<Compile Include="Src\Scripting\IPackageScriptFileName.cs" />
<Compile Include="Src\Scripting\IPackageScriptSession.cs" /> <Compile Include="Src\Scripting\IPackageScriptSession.cs" />
<Compile Include="Src\Scripting\PackageInitializeScript.cs" /> <Compile Include="Src\Scripting\PackageInitializeScript.cs" />
<Compile Include="Src\Scripting\PackageInitializeScriptFileName.cs" /> <Compile Include="Src\Scripting\PackageInitializeScriptFileName.cs" />

16
src/AddIns/Misc/PackageManagement/Project/Src/Scripting/IPackageScriptFileName.cs

@ -0,0 +1,16 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.Scripting
{
public interface IPackageScriptFileName
{
string PackageInstallDirectory { get; }
string ToString();
bool ScriptDirectoryExists();
bool FileExists();
string GetScriptDirectory();
}
}

2
src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageInitializeScript.cs

@ -9,7 +9,7 @@ namespace ICSharpCode.PackageManagement.Scripting
public class PackageInitializeScript : PackageScript public class PackageInitializeScript : PackageScript
{ {
public PackageInitializeScript( public PackageInitializeScript(
PackageInitializeScriptFileName fileName, IPackageScriptFileName fileName,
IPackageScriptSession session) IPackageScriptSession session)
: base(fileName, session) : base(fileName, session)
{ {

2
src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageInstallScript.cs

@ -8,7 +8,7 @@ namespace ICSharpCode.PackageManagement.Scripting
public class PackageInstallScript : PackageScript public class PackageInstallScript : PackageScript
{ {
public PackageInstallScript( public PackageInstallScript(
PackageInstallScriptFileName fileName, IPackageScriptFileName fileName,
IPackageScriptSession session) IPackageScriptSession session)
: base(fileName, session) : base(fileName, session)
{ {

17
src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageScript.cs

@ -10,14 +10,14 @@ namespace ICSharpCode.PackageManagement.Scripting
public class PackageScript : IPackageScript public class PackageScript : IPackageScript
{ {
public PackageScript( public PackageScript(
PackageScriptFileName fileName, IPackageScriptFileName fileName,
IPackageScriptSession session) IPackageScriptSession session)
{ {
this.ScriptFileName = fileName; this.ScriptFileName = fileName;
this.Session = session; this.Session = session;
} }
protected PackageScriptFileName ScriptFileName { get; private set; } protected IPackageScriptFileName ScriptFileName { get; private set; }
protected IPackageScriptSession Session { get; private set; } protected IPackageScriptSession Session { get; private set; }
public IPackage Package { get; set; } public IPackage Package { get; set; }
@ -26,15 +26,22 @@ namespace ICSharpCode.PackageManagement.Scripting
public void Execute() public void Execute()
{ {
BeforeExecute(); BeforeExecute();
AddSessionVariables(); if (ScriptFileExists()) {
ExecuteScript(); AddSessionVariables();
RemoveSessionVariables(); ExecuteScript();
RemoveSessionVariables();
}
} }
protected virtual void BeforeExecute() protected virtual void BeforeExecute()
{ {
} }
bool ScriptFileExists()
{
return ScriptFileName.FileExists();
}
void AddSessionVariables() void AddSessionVariables()
{ {
Session.AddVariable("__rootPath", ScriptFileName.PackageInstallDirectory); Session.AddVariable("__rootPath", ScriptFileName.PackageInstallDirectory);

2
src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageScriptFileName.cs

@ -7,7 +7,7 @@ using NuGet;
namespace ICSharpCode.PackageManagement.Scripting namespace ICSharpCode.PackageManagement.Scripting
{ {
public abstract class PackageScriptFileName public abstract class PackageScriptFileName : IPackageScriptFileName
{ {
IFileSystem fileSystem; IFileSystem fileSystem;
string relativeScriptFilePath; string relativeScriptFilePath;

2
src/AddIns/Misc/PackageManagement/Project/Src/Scripting/PackageUninstallScript.cs

@ -8,7 +8,7 @@ namespace ICSharpCode.PackageManagement.Scripting
public class PackageUninstallScript : PackageScript public class PackageUninstallScript : PackageScript
{ {
public PackageUninstallScript( public PackageUninstallScript(
PackageUninstallScriptFileName fileName, IPackageScriptFileName fileName,
IPackageScriptSession session) IPackageScriptSession session)
: base(fileName, session) : base(fileName, session)
{ {

1
src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj

@ -79,6 +79,7 @@
<Compile Include="Src\Helpers\FakePackageManagementProjectFactory.cs" /> <Compile Include="Src\Helpers\FakePackageManagementProjectFactory.cs" />
<Compile Include="Src\Helpers\FakePackageScript.cs" /> <Compile Include="Src\Helpers\FakePackageScript.cs" />
<Compile Include="Src\Helpers\FakePackageScriptFactory.cs" /> <Compile Include="Src\Helpers\FakePackageScriptFactory.cs" />
<Compile Include="Src\Helpers\FakePackageScriptFileName.cs" />
<Compile Include="Src\Helpers\FakePackageViewModelFactory.cs" /> <Compile Include="Src\Helpers\FakePackageViewModelFactory.cs" />
<Compile Include="Src\Helpers\FakePowerShellSession.cs" /> <Compile Include="Src\Helpers\FakePowerShellSession.cs" />
<Compile Include="Src\Helpers\TestableAddPackageReferenceCommand.cs" /> <Compile Include="Src\Helpers\TestableAddPackageReferenceCommand.cs" />

41
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageScriptFileName.cs

@ -0,0 +1,41 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.PackageManagement.Scripting;
namespace PackageManagement.Tests.Helpers
{
public class FakePackageScriptFileName : IPackageScriptFileName
{
public string PackageInstallDirectory { get; set; }
public bool ScriptDirectoryExistsReturnValue = true;
public bool ScriptDirectoryExists()
{
return ScriptDirectoryExistsReturnValue;
}
public bool FileExistsReturnValue = true;
public bool FileExists()
{
return FileExistsReturnValue;
}
public string GetScriptDirectoryReturnValue = String.Empty;
public string GetScriptDirectory()
{
return GetScriptDirectoryReturnValue;
}
public string ToStringReturnValue = String.Empty;
public override string ToString()
{
return ToStringReturnValue;
}
}
}

2
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePowerShellSession.cs

@ -35,10 +35,12 @@ namespace PackageManagement.Tests.Helpers
VariablesRemoved.Add(name); VariablesRemoved.Add(name);
} }
public bool IsScriptExecuted;
public string ScriptPassedToInvokeScript; public string ScriptPassedToInvokeScript;
public void InvokeScript(string script) public void InvokeScript(string script)
{ {
IsScriptExecuted = true;
ScriptPassedToInvokeScript = script; ScriptPassedToInvokeScript = script;
} }
} }

65
src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageInitializeScriptTests.cs

@ -13,32 +13,14 @@ namespace PackageManagement.Tests.Scripting
public class PackageInitializeScriptTests public class PackageInitializeScriptTests
{ {
PackageInitializeScript script; PackageInitializeScript script;
PackageInitializeScriptFileName scriptFileName;
FakeFileSystem fakeFileSystem;
FakePackageScriptSession fakeSession; FakePackageScriptSession fakeSession;
FakePackageScriptFileName fakeScriptFileName;
void CreateScript() void CreateScript()
{ {
fakeFileSystem = new FakeFileSystem(); fakeScriptFileName = new FakePackageScriptFileName();
fakeFileSystem.FileExistsReturnValue = true;
fakeFileSystem.DirectoryExistsReturnValue = true;
scriptFileName = new PackageInitializeScriptFileName(fakeFileSystem);
fakeSession = new FakePackageScriptSession();
script = new PackageInitializeScript(scriptFileName, fakeSession);
}
void CreateScriptWithPhysicalFileSystem()
{
CreateScriptWithPhysicalFileSystem(@"d:\projects\myproject\packages\test");
}
void CreateScriptWithPhysicalFileSystem(string packageInstallDirectory)
{
scriptFileName = new PackageInitializeScriptFileName(packageInstallDirectory);
fakeSession = new FakePackageScriptSession(); fakeSession = new FakePackageScriptSession();
script = new PackageInitializeScript(scriptFileName, fakeSession); script = new PackageInitializeScript(fakeScriptFileName, fakeSession);
} }
void AssertSessionVariableIsRemoved(string variableName) void AssertSessionVariableIsRemoved(string variableName)
@ -51,13 +33,13 @@ namespace PackageManagement.Tests.Scripting
public void Execute_ExistingEnvironmentPathIsEmptyString_PathToScriptAddedToEnvironmentPath() public void Execute_ExistingEnvironmentPathIsEmptyString_PathToScriptAddedToEnvironmentPath()
{ {
CreateScript(); CreateScript();
fakeFileSystem.PathToReturnFromGetFullPath = @"d:\projects\myproject\packages\test"; fakeScriptFileName.GetScriptDirectoryReturnValue = @"d:\projects\myproject\packages\test\tools";
fakeSession.SetEnvironmentPath(String.Empty); fakeSession.SetEnvironmentPath(String.Empty);
script.Execute(); script.Execute();
string actualEnvironmentPath = fakeSession.GetEnvironmentPath(); string actualEnvironmentPath = fakeSession.GetEnvironmentPath();
string expectedEnvironmentPath = @"d:\projects\myproject\packages\test"; string expectedEnvironmentPath = @"d:\projects\myproject\packages\test\tools";
Assert.AreEqual(expectedEnvironmentPath, actualEnvironmentPath); Assert.AreEqual(expectedEnvironmentPath, actualEnvironmentPath);
} }
@ -66,13 +48,13 @@ namespace PackageManagement.Tests.Scripting
public void Execute_OneItemInOriginalEnvironmentPath_PathToScriptAppendedToEnvironmentPath() public void Execute_OneItemInOriginalEnvironmentPath_PathToScriptAppendedToEnvironmentPath()
{ {
CreateScript(); CreateScript();
fakeFileSystem.PathToReturnFromGetFullPath = @"d:\projects\myproject\packages\test"; fakeScriptFileName.GetScriptDirectoryReturnValue = @"d:\projects\myproject\packages\test\tools";
fakeSession.SetEnvironmentPath(@"c:\users\sharpdevelop\ps;"); fakeSession.SetEnvironmentPath(@"c:\users\sharpdevelop\ps;");
script.Execute(); script.Execute();
string actualEnvironmentPath = fakeSession.GetEnvironmentPath(); string actualEnvironmentPath = fakeSession.GetEnvironmentPath();
string expectedEnvironmentPath = @"c:\users\sharpdevelop\ps;d:\projects\myproject\packages\test"; string expectedEnvironmentPath = @"c:\users\sharpdevelop\ps;d:\projects\myproject\packages\test\tools";
Assert.AreEqual(expectedEnvironmentPath, actualEnvironmentPath); Assert.AreEqual(expectedEnvironmentPath, actualEnvironmentPath);
} }
@ -81,13 +63,13 @@ namespace PackageManagement.Tests.Scripting
public void Execute_OneItemInOriginalEnvironmentPathMissingSemiColonAtEnd_PathToScriptAppendedToEnvironmentPathWithSemiColonAtStart() public void Execute_OneItemInOriginalEnvironmentPathMissingSemiColonAtEnd_PathToScriptAppendedToEnvironmentPathWithSemiColonAtStart()
{ {
CreateScript(); CreateScript();
fakeFileSystem.PathToReturnFromGetFullPath = @"d:\projects\myproject\packages\test"; fakeScriptFileName.GetScriptDirectoryReturnValue = @"d:\projects\myproject\packages\test\tools";
fakeSession.SetEnvironmentPath(@"c:\users\sharpdevelop\ps"); fakeSession.SetEnvironmentPath(@"c:\users\sharpdevelop\ps");
script.Execute(); script.Execute();
string actualEnvironmentPath = fakeSession.GetEnvironmentPath(); string actualEnvironmentPath = fakeSession.GetEnvironmentPath();
string expectedEnvironmentPath = @"c:\users\sharpdevelop\ps;d:\projects\myproject\packages\test"; string expectedEnvironmentPath = @"c:\users\sharpdevelop\ps;d:\projects\myproject\packages\test\tools";
Assert.AreEqual(expectedEnvironmentPath, actualEnvironmentPath); Assert.AreEqual(expectedEnvironmentPath, actualEnvironmentPath);
} }
@ -96,13 +78,13 @@ namespace PackageManagement.Tests.Scripting
public void Execute_OriginalEnvironmentPathIsNull_PathToScriptAppendedToEnvironmentPath() public void Execute_OriginalEnvironmentPathIsNull_PathToScriptAppendedToEnvironmentPath()
{ {
CreateScript(); CreateScript();
fakeFileSystem.PathToReturnFromGetFullPath = @"d:\projects\myproject\packages\test"; fakeScriptFileName.GetScriptDirectoryReturnValue = @"d:\projects\myproject\packages\test\tools";
fakeSession.SetEnvironmentPath(null); fakeSession.SetEnvironmentPath(null);
script.Execute(); script.Execute();
string actualEnvironmentPath = fakeSession.GetEnvironmentPath(); string actualEnvironmentPath = fakeSession.GetEnvironmentPath();
string expectedEnvironmentPath = @"d:\projects\myproject\packages\test"; string expectedEnvironmentPath = @"d:\projects\myproject\packages\test\tools";
Assert.AreEqual(expectedEnvironmentPath, actualEnvironmentPath); Assert.AreEqual(expectedEnvironmentPath, actualEnvironmentPath);
} }
@ -111,8 +93,8 @@ namespace PackageManagement.Tests.Scripting
public void Execute_ScriptDirectoryDoesNotExist_PathIsNotUpdated() public void Execute_ScriptDirectoryDoesNotExist_PathIsNotUpdated()
{ {
CreateScript(); CreateScript();
fakeFileSystem.PathToReturnFromGetFullPath = @"d:\projects\myproject\packages\test"; fakeScriptFileName.GetScriptDirectoryReturnValue = @"d:\projects\myproject\packages\test\tools";
fakeFileSystem.DirectoryExistsReturnValue = false; fakeScriptFileName.ScriptDirectoryExistsReturnValue = false;
fakeSession.SetEnvironmentPath(String.Empty); fakeSession.SetEnvironmentPath(String.Empty);
script.Execute(); script.Execute();
@ -126,7 +108,7 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageIsSet_PackageSessionVariableIsSet() public void Execute_PackageIsSet_PackageSessionVariableIsSet()
{ {
CreateScriptWithPhysicalFileSystem(); CreateScript();
var expectedPackage = new FakePackage("Test"); var expectedPackage = new FakePackage("Test");
script.Package = expectedPackage; script.Package = expectedPackage;
script.Execute(); script.Execute();
@ -139,8 +121,9 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_RootPathSessionVariableIsSet() public void Execute_PackageInstallDirectoryIsSet_RootPathSessionVariableIsSet()
{ {
CreateScript();
string expectedRootPath = @"d:\projects\myproject\packages\test"; string expectedRootPath = @"d:\projects\myproject\packages\test";
CreateScriptWithPhysicalFileSystem(expectedRootPath); fakeScriptFileName.PackageInstallDirectory = expectedRootPath;
script.Execute(); script.Execute();
var rootPath = fakeSession.VariablesAdded["__rootPath"]; var rootPath = fakeSession.VariablesAdded["__rootPath"];
@ -151,7 +134,8 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_ToolsPathSessionVariableIsSet() public void Execute_PackageInstallDirectoryIsSet_ToolsPathSessionVariableIsSet()
{ {
CreateScriptWithPhysicalFileSystem(@"d:\projects\myproject\packages\test"); CreateScript();
fakeScriptFileName.GetScriptDirectoryReturnValue = @"d:\projects\myproject\packages\test\tools";
script.Execute(); script.Execute();
var toolsPath = fakeSession.VariablesAdded["__toolsPath"]; var toolsPath = fakeSession.VariablesAdded["__toolsPath"];
@ -163,7 +147,7 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_ProjectSessionVariableIsSet() public void Execute_PackageInstallDirectoryIsSet_ProjectSessionVariableIsSet()
{ {
CreateScriptWithPhysicalFileSystem(); CreateScript();
script.Execute(); script.Execute();
var project = fakeSession.VariablesAdded["__project"]; var project = fakeSession.VariablesAdded["__project"];
@ -174,7 +158,8 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_ScriptIsInvoked() public void Execute_PackageInstallDirectoryIsSet_ScriptIsInvoked()
{ {
CreateScriptWithPhysicalFileSystem(@"d:\projects\myproject\packages\test"); CreateScript();
fakeScriptFileName.ToStringReturnValue = @"d:\projects\myproject\packages\test\tools\init.ps1";
script.Execute(); script.Execute();
string actualScript = fakeSession.ScriptPassedToInvokeScript; string actualScript = fakeSession.ScriptPassedToInvokeScript;
@ -188,7 +173,7 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_PackageSessionVariableIsRemoved() public void Execute_PackageInstallDirectoryIsSet_PackageSessionVariableIsRemoved()
{ {
CreateScriptWithPhysicalFileSystem(); CreateScript();
script.Execute(); script.Execute();
AssertSessionVariableIsRemoved("__package"); AssertSessionVariableIsRemoved("__package");
@ -197,7 +182,7 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_RootPathSessionVariableIsRemoved() public void Execute_PackageInstallDirectoryIsSet_RootPathSessionVariableIsRemoved()
{ {
CreateScriptWithPhysicalFileSystem(); CreateScript();
script.Execute(); script.Execute();
AssertSessionVariableIsRemoved("__rootPath"); AssertSessionVariableIsRemoved("__rootPath");
@ -206,7 +191,7 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_ToolsPathSessionVariableIsRemoved() public void Execute_PackageInstallDirectoryIsSet_ToolsPathSessionVariableIsRemoved()
{ {
CreateScriptWithPhysicalFileSystem(); CreateScript();
script.Execute(); script.Execute();
AssertSessionVariableIsRemoved("__toolsPath"); AssertSessionVariableIsRemoved("__toolsPath");
@ -215,7 +200,7 @@ namespace PackageManagement.Tests.Scripting
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_ProjectSessionVariableIsRemoved() public void Execute_PackageInstallDirectoryIsSet_ProjectSessionVariableIsRemoved()
{ {
CreateScriptWithPhysicalFileSystem(); CreateScript();
script.Execute(); script.Execute();
AssertSessionVariableIsRemoved("__project"); AssertSessionVariableIsRemoved("__project");

39
src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageInstallScriptTests.cs

@ -16,23 +16,24 @@ namespace PackageManagement.Tests.Scripting
PackageInstallScriptFileName scriptFileName; PackageInstallScriptFileName scriptFileName;
FakePackageScriptSession fakeSession; FakePackageScriptSession fakeSession;
PackageInstallScript script; PackageInstallScript script;
FakeFileSystem fakeFileSystem;
void CreateScriptWithPhysicalFileSystem() void CreateScript()
{ {
CreateScriptWithPhysicalFileSystem(@"d:\projects\myproject\packages\test"); fakeFileSystem = new FakeFileSystem();
} fakeFileSystem.FileExistsReturnValue = true;
fakeFileSystem.DirectoryExistsReturnValue = true;
scriptFileName = new PackageInstallScriptFileName(fakeFileSystem);
void CreateScriptWithPhysicalFileSystem(string packageInstallDirectory)
{
scriptFileName = new PackageInstallScriptFileName(packageInstallDirectory);
fakeSession = new FakePackageScriptSession(); fakeSession = new FakePackageScriptSession();
script = new PackageInstallScript(scriptFileName, fakeSession); script = new PackageInstallScript(scriptFileName, fakeSession);
} }
[Test] [Test]
public void Execute_PackageInstallDirectoryIsSet_ProjectSessionVariableIsSet() public void Execute_PackageInstallDirectoryIsSet_ProjectSessionVariableIsSet()
{ {
CreateScriptWithPhysicalFileSystem(); CreateScript();
var expectedProject = new Project(); var expectedProject = new Project();
var project = new FakePackageManagementProject(); var project = new FakePackageManagementProject();
project.DTEProject = expectedProject; project.DTEProject = expectedProject;
@ -43,5 +44,29 @@ namespace PackageManagement.Tests.Scripting
Assert.AreEqual(expectedProject, projectVariable); Assert.AreEqual(expectedProject, projectVariable);
} }
[Test]
public void Execute_ScriptDoesNotExist_ScriptIsNotExecuted()
{
CreateScript();
fakeFileSystem.FileExistsReturnValue = false;
script.Execute();
bool executed = fakeSession.IsScriptExecuted;
Assert.IsFalse(executed);
}
[Test]
public void Execute_ScriptDoesNotExist_InstallScriptCheckedForExistence()
{
CreateScript();
fakeFileSystem.FileExistsReturnValue = false;
script.Execute();
string fileChecked = fakeFileSystem.PathPassedToFileExists;
Assert.AreEqual(@"tools\install.ps1", fileChecked);
}
} }
} }

Loading…
Cancel
Save