public void TestBootstrapNuGet() { // delete any copies of nuget if they are installed. if (IsNuGetInstalled) { DeleteNuGet(); } // verify that nuget is not installed. Assert.False(IsNuGetInstalled, "NuGet is still installed at :".format(NuGetPath)); var ps = NewPowerShellSession; // ask onget for the nuget package provider, bootstrapping if necessary DynamicPowershellResult result = ps.GetPackageProvider(Name: "NuGet", ForceBootstrap: true, IsTesting: true); Assert.False(result.IsFailing); // did we get back one item? var items = result.ToArray(); Assert.Equal(1, items.Length); // and is the nuget.exe where we expect it? Assert.True(IsNuGetInstalled); }
public void TestGetPackageProviderName() { var ps = NewPowerShellSession; DynamicPowershellResult result = ps.GetPackageProvider(Name: "NuGet", ForceBootstrap: true, Force: true, IsTesting: true); result.WaitForCompletion(); Assert.False(result.IsFailing, "Failed to get package provider."); var items = result.ToArray(); Assert.Equal(1, items.Length); }