File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
MigrationTools.Clients.TfsObjectModel.Tests/Tools
MigrationTools.Clients.TfsObjectModel
MigrationTools.Tests/Tools/FieldMaps Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ using Microsoft . Extensions . DependencyInjection ;
2+ using Microsoft . VisualStudio . TestTools . UnitTesting ;
3+ using MigrationTools . FieldMaps . AzureDevops . ObjectModel ;
4+ using MigrationTools . Tests ;
5+
6+ namespace MigrationTools . Clients . TfsObjectModel . Tests . Tools
7+ {
8+ [ TestClass ]
9+ public class FieldClearMapServiceRegistrationTests
10+ {
11+ [ TestMethod , TestCategory ( "L0" ) ]
12+ public void FieldClearMap_ServiceRegistration_ShouldResolveFromDI ( )
13+ {
14+ // Arrange
15+ var services = ServiceProviderHelper . GetServices ( ) ;
16+
17+ // Act & Assert - This will throw if FieldClearMap is not registered
18+ var fieldClearMap = services . GetService < FieldClearMap > ( ) ;
19+ Assert . IsNotNull ( fieldClearMap , "FieldClearMap should be registered in the DI container and resolvable" ) ;
20+ }
21+ }
22+ }
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ public static void AddMigrationToolServicesForClientLegacyAzureDevOpsObjectModel
8282 context . AddTransient < RegexFieldMap > ( ) ;
8383 context . AddTransient < TreeToTagFieldMap > ( ) ;
8484 context . AddTransient < FieldCalculationMap > ( ) ;
85+ context . AddTransient < FieldClearMap > ( ) ;
8586
8687 // Core
8788 context . AddTransient < IMigrationClient , TfsTeamProjectEndpoint > ( ) ;
Original file line number Diff line number Diff line change 1+ using Microsoft . VisualStudio . TestTools . UnitTesting ;
2+ using MigrationTools . Tools ;
3+
4+ namespace MigrationTools . Tests . Tools . FieldMaps
5+ {
6+ [ TestClass ]
7+ public class FieldClearMapTests
8+ {
9+ [ TestMethod ]
10+ public void FieldClearMapOptions_SetExampleConfigDefaults_ShouldSetCorrectValues ( )
11+ {
12+ // Arrange
13+ var options = new FieldClearMapOptions ( ) ;
14+
15+ // Act
16+ options . SetExampleConfigDefaults ( ) ;
17+
18+ // Assert
19+ Assert . AreEqual ( "System.Description" , options . targetField ) ;
20+ CollectionAssert . Contains ( options . ApplyTo , "*" ) ;
21+ }
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments