Skip to content

Commit

Permalink
remove duplicate tests (#5871)
Browse files Browse the repository at this point in the history
  • Loading branch information
SueSu01 authored Jun 26, 2024
1 parent 461a64c commit cc61f49
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 1,067 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,106 +245,6 @@ public async Task WithSourceMappingEnabled_InstallPackageFromPMUIAndNoSourcesFou
}
}

[DataTestMethod]
[DynamicData(nameof(GetNetCoreTemplates), DynamicDataSourceType.Method)]
[Timeout(DefaultTimeout)]
public async Task InstallPackageToNetCoreProjectFromUI(ProjectTemplate projectTemplate)
{
EnsureVisualStudioHost();

using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, addNetStandardFeeds: true))
{
// Arrange
var packageName = "NetCoreInstallTestPackage";
var packageVersion = "1.0.0";
await CommonUtility.CreatePackageInSourceAsync(testContext.PackageSource, packageName, packageVersion);

VisualStudio.AssertNoErrors();

// Act
CommonUtility.OpenNuGetPackageManagerWithDte(VisualStudio, Logger);
var nugetTestService = GetNuGetTestService();
var uiwindow = nugetTestService.GetUIWindowfromProject(testContext.Project);
uiwindow.InstallPackageFromUI(packageName, packageVersion);

// Assert
VisualStudio.AssertNuGetOutputDoesNotHaveErrors();
CommonUtility.AssertPackageReferenceExists(VisualStudio, testContext.Project, packageName, packageVersion, Logger);
}
}

[DataTestMethod]
[DynamicData(nameof(GetNetCoreTemplates), DynamicDataSourceType.Method)]
[Timeout(DefaultTimeout)]
public async Task UpdatePackageToNetCoreProjectFromUI(ProjectTemplate projectTemplate)
{
EnsureVisualStudioHost();

using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, addNetStandardFeeds: true))
{
// Arrange
var packageName = "NetCoreUpdateTestPackage";
var packageVersion1 = "1.0.0";
var packageVersion2 = "2.0.0";

await CommonUtility.CreatePackageInSourceAsync(testContext.PackageSource, packageName, packageVersion1);
await CommonUtility.CreatePackageInSourceAsync(testContext.PackageSource, packageName, packageVersion2);

VisualStudio.AssertNoErrors();

// Act
CommonUtility.OpenNuGetPackageManagerWithDte(VisualStudio, Logger);
var nugetTestService = GetNuGetTestService();
var uiwindow = nugetTestService.GetUIWindowfromProject(testContext.Project);
uiwindow.InstallPackageFromUI(packageName, packageVersion1);
testContext.SolutionService.Build();
testContext.NuGetApexTestService.WaitForAutoRestore();

uiwindow.UpdatePackageFromUI(packageName, packageVersion2);
testContext.SolutionService.Build();
testContext.NuGetApexTestService.WaitForAutoRestore();

// Assert
VisualStudio.AssertNuGetOutputDoesNotHaveErrors();
CommonUtility.AssertPackageReferenceExists(VisualStudio, testContext.Project, packageName, packageVersion2, Logger);
}
}

[DataTestMethod]
[DynamicData(nameof(GetNetCoreTemplates), DynamicDataSourceType.Method)]
[Timeout(DefaultTimeout)]
public async Task UninstallPackageFromNetCoreProjectFromUI(ProjectTemplate projectTemplate)
{
EnsureVisualStudioHost();

using (var testContext = new ApexTestContext(VisualStudio, projectTemplate, Logger, addNetStandardFeeds: true))
{
// Arrange
var packageName = "NetCoreUninstallTestPackage";
var packageVersion = "1.0.0";

await CommonUtility.CreatePackageInSourceAsync(testContext.PackageSource, packageName, packageVersion);

VisualStudio.AssertNoErrors();

// Act
CommonUtility.OpenNuGetPackageManagerWithDte(VisualStudio, Logger);
var nugetTestService = GetNuGetTestService();
var uiwindow = nugetTestService.GetUIWindowfromProject(testContext.Project);
uiwindow.InstallPackageFromUI(packageName, packageVersion);
testContext.SolutionService.Build();
testContext.NuGetApexTestService.WaitForAutoRestore();

uiwindow.UninstallPackageFromUI(packageName);
testContext.SolutionService.Build();
testContext.NuGetApexTestService.WaitForAutoRestore();

// Assert
VisualStudio.AssertNuGetOutputDoesNotHaveErrors();
CommonUtility.AssertPackageReferenceDoesNotExist(VisualStudio, testContext.Project, packageName, Logger);
}
}

// There is a bug with VS or Apex where NetCoreConsoleApp and NetCoreClassLib create netcore 2.1 projects that are not supported by the sdk
// Commenting out any NetCoreConsoleApp or NetCoreClassLib template and swapping it for NetStandardClassLib as both are package ref.

Expand Down
Loading

0 comments on commit cc61f49

Please sign in to comment.