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

                fixture.GivenDefaultToolDoNotExist();

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

                // Then
                AssertEx.IsCakeException(result, "Chocolatey: Could not locate executable.");
            }
Beispiel #2
0
            public void Should_Find_Chocolatey_Executable_By_Resolver_If_Found()
            {
                // Given
                var fixture = new ChocolateyApiKeySetterFixture();

                fixture.GivenDefaultToolDoNotExist();
                fixture.Resolver.ResolvePath().Returns(new FilePath("/Resolved/choco.exe"));
                fixture.FileSystem.CreateFile("/Resolved/choco.exe");

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("/Resolved/choco.exe", result.Path.FullPath);
            }