Beispiel #1
0
            public void Should_Throw_If_Addins_Could_Not_Be_Found()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                // When
                var result = Record.Exception(() => fixture.InstallAddins());

                // Then
                Assert.IsCakeException(result, "Failed to install addin 'addin'.");
            }
Beispiel #2
0
            public void Should_Throw_If_Install_Path_Is_Null()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.InstallPath = null;

                // When
                var result = Record.Exception(() => fixture.InstallAddins());

                // Then
                Assert.IsArgumentNullException(result, "installPath");
            }
Beispiel #3
0
            public void Should_Throw_If_Installer_Could_Not_Be_Resolved()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.GivenNoInstallerCouldBeResolved();

                // When
                var result = Record.Exception(() => fixture.InstallAddins());

                // Then
                Assert.IsCakeException(result, "Could not find an installer for the 'custom' scheme.");
            }
            public void Should_Throw_If_Analyzer_Result_Is_Null()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.Result = null;

                // When
                var result = Record.Exception(() => fixture.InstallAddins());

                // Then
                AssertEx.IsArgumentNullException(result, "analyzerResult");
            }
Beispiel #5
0
            public void Should_Not_Install_Addins_Present_On_Disk()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.GivenAddinFilesAlreadyHaveBeenDownloaded();

                // When
                fixture.InstallAddins();

                // Then
                fixture.Installer.Received(0)
                .InstallPackage(Arg.Any <NuGetPackage>(), Arg.Any <DirectoryPath>());
            }
Beispiel #6
0
            public void Should_Install_Addins_Referenced_By_Scripts()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.GivenFilesWillBeInstalled();

                // When
                fixture.InstallAddins();

                // Then
                fixture.Installer.Received().Install(
                    Arg.Is <PackageReference>(package => package.OriginalString == "custom:?package=addin"),
                    Arg.Is <PackageType>(type => type == PackageType.Addin),
                    Arg.Is <DirectoryPath>(path => path.FullPath == "/Working/Bin"));
            }
Beispiel #7
0
            public void Should_Install_Addins_Referenced_By_Scripts()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.GivenAddinFilesAreDownloaded();

                // When
                fixture.InstallAddins();

                // Then
                fixture.Installer.Received(1).InstallPackage(
                    Arg.Is <NuGetPackage>(package =>
                                          package.PackageId == "Addin" &&
                                          package.Source == "http://example.com"),
                    Arg.Any <DirectoryPath>());
            }