@@ -233,7 +233,62 @@ public async Task WithSourceMappingEnabled_InstallPackageFromPMUIAndNoSourcesFou
233233 }
234234 }
235235
236- // There is a bug with VS or Apex where NetCoreConsoleApp and NetCoreClassLib create netcore 2.1 projects that are not supported by the sdk
236+ [ TestMethod ]
237+ [ Timeout ( DefaultTimeout ) ]
238+ [ TestCategory ( "Gate" ) ]
239+ public async Task InstallPackageToNetCoreProjectFromUI_VerifiesRestore ( )
240+ {
241+ // Arrange
242+ using ( var testContext = new ApexTestContext ( VisualStudio , ProjectTemplate . NetStandardClassLib , Logger , addNetStandardFeeds : true ) )
243+ {
244+ var packageName = "Contoso.A" ;
245+ var packageVersion = "1.0.0" ;
246+ await CommonUtility . CreatePackageInSourceAsync ( testContext . PackageSource , packageName , packageVersion ) ;
247+
248+ // Act
249+ CommonUtility . OpenNuGetPackageManagerWithDte ( VisualStudio , Logger ) ;
250+ var nugetTestService = GetNuGetTestService ( ) ;
251+ var uiwindow = nugetTestService . GetUIWindowfromProject ( testContext . Project ) ;
252+ uiwindow . InstallPackageFromUI ( packageName , packageVersion ) ;
253+
254+ // Assert
255+ VisualStudio . AssertNuGetOutputDoesNotHaveErrors ( ) ;
256+ CommonUtility . AssertPackageReferenceExists ( testContext . Project , packageName , packageVersion , Logger ) ;
257+ CommonUtility . AssertPackageInAssetsFile ( VisualStudio , testContext . Project , packageName , packageVersion , Logger ) ;
258+ }
259+ }
260+
261+ [ TestMethod ]
262+ [ Timeout ( DefaultTimeout ) ]
263+ [ TestCategory ( "Gate" ) ]
264+ public async Task UpdatePackageToNetCoreProjectFromUI_VerifiesRestore ( )
265+ {
266+ // Arrange
267+ using ( var testContext = new ApexTestContext ( VisualStudio , ProjectTemplate . NetStandardClassLib , Logger , addNetStandardFeeds : true ) )
268+ {
269+ var packageName = "Contoso.A" ;
270+ var packageVersionV1 = "1.0.0" ;
271+ var packageVersionV2 = "2.0.0" ;
272+ await CommonUtility . CreatePackageInSourceAsync ( testContext . PackageSource , packageName , packageVersionV1 ) ;
273+ await CommonUtility . CreatePackageInSourceAsync ( testContext . PackageSource , packageName , packageVersionV2 ) ;
274+
275+ CommonUtility . OpenNuGetPackageManagerWithDte ( VisualStudio , Logger ) ;
276+ var nugetTestService = GetNuGetTestService ( ) ;
277+ var uiwindow = nugetTestService . GetUIWindowfromProject ( testContext . Project ) ;
278+ uiwindow . InstallPackageFromUI ( packageName , packageVersionV1 ) ;
279+
280+ // Act
281+ VisualStudio . ClearWindows ( ) ;
282+ uiwindow . UpdatePackageFromUI ( packageName , packageVersionV2 ) ;
283+
284+ // Assert
285+ VisualStudio . AssertNuGetOutputDoesNotHaveErrors ( ) ;
286+ CommonUtility . AssertPackageReferenceExists ( testContext . Project , packageName , packageVersionV2 , Logger ) ;
287+ CommonUtility . AssertPackageInAssetsFile ( VisualStudio , testContext . Project , packageName , packageVersionV2 , Logger ) ;
288+ }
289+ }
290+
291+
237292 // Commenting out any NetCoreConsoleApp or NetCoreClassLib template and swapping it for NetStandardClassLib as both are package ref.
238293
239294 public static IEnumerable < object [ ] > GetNetCoreTemplates ( )
0 commit comments