コード例 #1
0
            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);
            }
コード例 #2
0
            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);
            }
コード例 #3
0
            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);
            }
コード例 #4
0
            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);
            }