public void Should_Be_Able_To_Install_If_Scheme_Is_Correct() { // Given var fixture = new DotNetToolPackageInstallerFixture(); fixture.Package = new PackageReference("dotnet:?package=Octopus.DotNet.Cli"); // When var result = fixture.CanInstall(); // Then Assert.True(result); }
public void Should_Not_Be_Able_To_Install_If_Scheme_Is_Incorrect() { // Given var fixture = new DotNetToolPackageInstallerFixture(); fixture.Package = new PackageReference("homebrew:?package=windirstat"); // When var result = fixture.CanInstall(); // Then Assert.False(result); }
public void Should_Throw_If_URI_Is_Null() { // Given var fixture = new DotNetToolPackageInstallerFixture(); fixture.Package = null; // When var result = Record.Exception(() => fixture.CanInstall()); // Then Assert.IsType <ArgumentNullException>(result); Assert.Equal("package", ((ArgumentNullException)result).ParamName); }
public void Should_Throw_If_Content_Resolver_Is_Null() { // Given var fixture = new DotNetToolPackageInstallerFixture(); fixture.ContentResolver = null; // When var result = Record.Exception(() => fixture.CreateInstaller()); // Then Assert.IsType <ArgumentNullException>(result); Assert.Equal("contentResolver", ((ArgumentNullException)result).ParamName); }