public void Should_Throw_If_Tools_Could_Not_Be_Found() { // Given var fixture = new ScriptProcessorFixture(); // When var result = Record.Exception(() => fixture.InstallTools()); // Then Assert.IsCakeException(result, "Failed to install tool 'tool'."); }
public void Should_Throw_If_Installer_Could_Not_Be_Resolved() { // Given var fixture = new ScriptProcessorFixture(); fixture.GivenNoInstallerCouldBeResolved(); // When var result = Record.Exception(() => fixture.InstallTools()); // Then Assert.IsCakeException(result, "Could not find an installer for the 'custom' scheme."); }
public void Should_Throw_If_Install_Path_Is_Null() { // Given var fixture = new ScriptProcessorFixture(); fixture.InstallPath = null; // When var result = Record.Exception(() => fixture.InstallTools()); // Then Assert.IsArgumentNullException(result, "installPath"); }
public void Should_Throw_If_Analyzer_Result_Is_Null() { // Given var fixture = new ScriptProcessorFixture(); fixture.Result = null; // When var result = Record.Exception(() => fixture.InstallTools()); // Then Assert.IsArgumentNullException(result, "analyzerResult"); }
public void Should_Register_Installed_Tools_With_The_Tool_Service() { // Given var fixture = new ScriptProcessorFixture(); fixture.GivenFilesWillBeInstalled(); // When fixture.InstallTools(); // Then fixture.Tools.Received(1).RegisterFile( Arg.Is <FilePath>(path => path.FullPath == "/Working/Bin/Temp.dll")); }
public void Should_Not_Install_Addins_Present_On_Disc() { // Given var fixture = new ScriptProcessorFixture(); fixture.GivenToolFilesAlreadyHaveBeenDownloaded(); // When fixture.InstallTools(); // Then fixture.Installer.Received(0) .InstallPackage(Arg.Any <NuGetPackage>(), Arg.Any <DirectoryPath>()); }
public void Should_Install_Tools_Referenced_By_Scripts() { // Given var fixture = new ScriptProcessorFixture(); fixture.GivenFilesWillBeInstalled(); // When fixture.InstallTools(); // Then fixture.Installer.Received(1).Install( Arg.Is <PackageReference>(package => package.OriginalString == "custom:?package=tool"), Arg.Is <PackageType>(type => type == PackageType.Tool), Arg.Is <DirectoryPath>(path => path.FullPath == "/Working/Bin")); }
public void Should_Install_Tools_Referenced_By_Scripts() { // Given var fixture = new ScriptProcessorFixture(); fixture.GivenToolFilesAreDownloaded(); // When fixture.InstallTools(); // Then fixture.Installer.Received(1).InstallPackage( Arg.Is <NuGetPackage>(package => package.PackageId == "Tool" && package.Source == "http://example.com"), Arg.Any <DirectoryPath>()); }