44#if ! WINDOWS_UWP && ! WIN_UI
55using AwesomeAssertions ;
66
7+ using Microsoft . VisualStudio . TestPlatform . MSTest . TestAdapter . Helpers ;
78using Microsoft . VisualStudio . TestPlatform . MSTestAdapter . PlatformServices ;
89using Microsoft . VisualStudio . TestPlatform . MSTestAdapter . PlatformServices . Deployment ;
910using Microsoft . VisualStudio . TestPlatform . MSTestAdapter . PlatformServices . Utilities ;
@@ -24,7 +25,7 @@ public class TestDeploymentTests : TestContainer
2425 private const string DefaultDeploymentItemPath = @"c:\temp" ;
2526 private const string DefaultDeploymentItemOutputDirectory = "out" ;
2627
27- private readonly Mock < ReflectionUtility > _mockReflectionUtility ;
28+ private readonly Mock < ReflectHelper > _mockReflectHelper ;
2829 private readonly Mock < FileUtility > _mockFileUtility ;
2930
3031#pragma warning disable IDE0044 // Add readonly modifier
@@ -33,7 +34,7 @@ public class TestDeploymentTests : TestContainer
3334
3435 public TestDeploymentTests ( )
3536 {
36- _mockReflectionUtility = new Mock < ReflectionUtility > ( ) ;
37+ _mockReflectHelper = new Mock < ReflectHelper > ( ) ;
3738 _mockFileUtility = new Mock < FileUtility > ( ) ;
3839 _warnings = [ ] ;
3940
@@ -52,7 +53,7 @@ public void GetDeploymentItemsReturnsNullWhenNoDeploymentItems()
5253 public void GetDeploymentItemsReturnsDeploymentItems ( )
5354 {
5455 // Arrange.
55- var testDeployment = new TestDeployment ( new DeploymentItemUtility ( _mockReflectionUtility . Object ) , null ! , null ! ) ;
56+ var testDeployment = new TestDeployment ( new DeploymentItemUtility ( _mockReflectHelper . Object ) , null ! , null ! ) ;
5657
5758 // setup mocks
5859 KeyValuePair < string , string > [ ] methodLevelDeploymentItems =
@@ -181,7 +182,7 @@ public void DeployShouldReturnFalseWhenDeploymentEnabledSetToFalseButHasDeployme
181182 testCase . SetPropertyValue ( DeploymentItemUtilityTests . DeploymentItemsProperty , kvpArray ) ;
182183
183184 var testDeployment = new TestDeployment (
184- new DeploymentItemUtility ( _mockReflectionUtility . Object ) ,
185+ new DeploymentItemUtility ( _mockReflectHelper . Object ) ,
185186 new DeploymentUtility ( ) ,
186187 _mockFileUtility . Object ) ;
187188
@@ -204,7 +205,7 @@ public void DeployShouldReturnFalseWhenDeploymentEnabledSetToFalseAndHasNoDeploy
204205 var testCase = new TestCase ( "A.C.M" , new Uri ( "executor://testExecutor" ) , "path/to/asm.dll" ) ;
205206 testCase . SetPropertyValue ( DeploymentItemUtilityTests . DeploymentItemsProperty , null ) ;
206207 var testDeployment = new TestDeployment (
207- new DeploymentItemUtility ( _mockReflectionUtility . Object ) ,
208+ new DeploymentItemUtility ( _mockReflectHelper . Object ) ,
208209 new DeploymentUtility ( ) ,
209210 _mockFileUtility . Object ) ;
210211
@@ -227,7 +228,7 @@ public void DeployShouldReturnFalseWhenDeploymentEnabledSetToTrueButHasNoDeploym
227228 var testCase = new TestCase ( "A.C.M" , new Uri ( "executor://testExecutor" ) , "path/to/asm.dll" ) ;
228229 testCase . SetPropertyValue ( DeploymentItemUtilityTests . DeploymentItemsProperty , null ) ;
229230 var testDeployment = new TestDeployment (
230- new DeploymentItemUtility ( _mockReflectionUtility . Object ) ,
231+ new DeploymentItemUtility ( _mockReflectHelper . Object ) ,
231232 new DeploymentUtility ( ) ,
232233 _mockFileUtility . Object ) ;
233234
@@ -257,7 +258,7 @@ internal void DeployShouldReturnTrueWhenDeploymentEnabledSetToTrueAndHasDeployme
257258 ] ;
258259 testCase . SetPropertyValue ( DeploymentItemUtilityTests . DeploymentItemsProperty , kvpArray ) ;
259260 var testDeployment = new TestDeployment (
260- new DeploymentItemUtility ( _mockReflectionUtility . Object ) ,
261+ new DeploymentItemUtility ( _mockReflectHelper . Object ) ,
261262 new DeploymentUtility ( ) ,
262263 _mockFileUtility . Object ) ;
263264
@@ -370,11 +371,9 @@ private void SetupDeploymentItems(MemberInfo memberInfo, KeyValuePair<string, st
370371 deploymentItemAttributes . Add ( new DeploymentItemAttribute ( deploymentItem . Key , deploymentItem . Value ) ) ;
371372 }
372373
373- _mockReflectionUtility . Setup (
374- ru =>
375- ru . GetCustomAttributes (
376- memberInfo ,
377- typeof ( DeploymentItemAttribute ) ) ) . Returns ( deploymentItemAttributes . ToArray ( ) ) ;
374+ _mockReflectHelper
375+ . Setup ( ru => ru . GetAttributes < DeploymentItemAttribute > ( memberInfo ) )
376+ . Returns ( deploymentItemAttributes . ToArray ( ) ) ;
378377 }
379378
380379 private static TestCase GetTestCase ( string source )
@@ -418,7 +417,7 @@ private TestDeployment CreateAndSetupDeploymentRelatedUtilities(out TestRunDirec
418417 _mockFileUtility . Setup ( fu => fu . GetNextIterationDirectoryName ( It . IsAny < string > ( ) , It . IsAny < string > ( ) ) )
419418 . Returns ( testRunDirectories . RootDeploymentDirectory ) ;
420419
421- var deploymentItemUtility = new DeploymentItemUtility ( _mockReflectionUtility . Object ) ;
420+ var deploymentItemUtility = new DeploymentItemUtility ( _mockReflectHelper . Object ) ;
422421
423422 return new TestDeployment (
424423 deploymentItemUtility ,
0 commit comments