Skip to content

Commit 3401c12

Browse files
committed
Rename FieldMappings to SourceFieldMappings
1 parent 33fd118 commit 3401c12

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/MigrationTools.Clients.TfsObjectModel.Tests/Tools/FieldReferenceNameMappingToolOptionsTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ public class FieldReferenceNameMappingToolOptionsTests
1010
public void FieldMappingsMustNotBeNullWhenNormalized()
1111
{
1212
TfsWorkItemTypeValidatorToolOptions options = new() { Enabled = true };
13-
options.FieldMappings = null;
13+
options.SourceFieldMappings = null;
1414
options.Normalize();
1515

16-
Assert.IsNotNull(options.FieldMappings);
16+
Assert.IsNotNull(options.SourceFieldMappings);
1717
}
1818

1919
[TestMethod]
@@ -22,7 +22,7 @@ public void ShouldLookupValueCaseInsensitively()
2222
TfsWorkItemTypeValidatorToolOptions options = new()
2323
{
2424
Enabled = true,
25-
FieldMappings = new()
25+
SourceFieldMappings = new()
2626
{
2727
["wit"] = new()
2828
{
@@ -44,7 +44,7 @@ public void ShouldReturnSourceValueIfNotMapped()
4444
TfsWorkItemTypeValidatorToolOptions options = new()
4545
{
4646
Enabled = true,
47-
FieldMappings = new()
47+
SourceFieldMappings = new()
4848
{
4949
["wit"] = new()
5050
{
@@ -64,7 +64,7 @@ public void ShouldReturnEmptyStringIfMappedToEmptyString()
6464
TfsWorkItemTypeValidatorToolOptions options = new()
6565
{
6666
Enabled = true,
67-
FieldMappings = new()
67+
SourceFieldMappings = new()
6868
{
6969
["wit"] = new()
7070
{
@@ -86,7 +86,7 @@ public void ShouldHandleAllWorkItemTypes()
8686
TfsWorkItemTypeValidatorToolOptions options = new()
8787
{
8888
Enabled = true,
89-
FieldMappings = new()
89+
SourceFieldMappings = new()
9090
{
9191
[TfsWorkItemTypeValidatorToolOptions.AllWorkItemTypes] = new()
9292
{

src/MigrationTools.Clients.TfsObjectModel/Tools/TfsWorkItemTypeValidatorTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private void LogValidationResult(bool isValid)
283283

284284
const string message1 = "Some work item types or their fields are not present in the target system (see previous logs)."
285285
+ " Either add these fields into target work items, or map source fields to other target fields"
286-
+ $" in options ({nameof(TfsWorkItemTypeValidatorToolOptions.FieldMappings)}).";
286+
+ $" in options ({nameof(TfsWorkItemTypeValidatorToolOptions.SourceFieldMappings)}).";
287287
Log.LogError(message1);
288288
const string message2 = "If you have some field mappings defined for validation, do not forget also to configure"
289289
+ $" proper field mapping in {nameof(FieldMappingTool)} so data will preserved during migration.";

src/MigrationTools.Clients.TfsObjectModel/Tools/TfsWorkItemTypeValidatorToolOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public TfsWorkItemTypeValidatorToolOptions()
3030
/// target field name. Target field name can be empty string to indicate that this field will not be validated in target.
3131
/// As work item type name, you can use <c>*</c> to define mappings which will be applied to all work item types.
3232
/// </summary>
33-
public Dictionary<string, Dictionary<string, string>> FieldMappings { get; set; } = [];
33+
public Dictionary<string, Dictionary<string, string>> SourceFieldMappings { get; set; } = [];
3434

3535
/// <summary>
3636
/// <para>
@@ -57,7 +57,7 @@ public void Normalize()
5757
return;
5858
}
5959

60-
Dictionary<string, Dictionary<string, string>> oldMappings = FieldMappings;
60+
Dictionary<string, Dictionary<string, string>> oldMappings = SourceFieldMappings;
6161
Dictionary<string, Dictionary<string, string>> newMappings = new(_normalizedComparer);
6262
if (oldMappings is not null)
6363
{
@@ -84,7 +84,7 @@ public void Normalize()
8484

8585
IncludeWorkItemtypes ??= [];
8686
FixedTargetFields = newFixedFields;
87-
FieldMappings = newMappings;
87+
SourceFieldMappings = newMappings;
8888
_isNormalized = true;
8989
}
9090

@@ -141,7 +141,7 @@ public string GetTargetFieldName(string workItemType, string sourceFieldName, ou
141141

142142
private bool TryGetTargetFieldName(string workItemType, string sourceFieldName, out string targetFieldName)
143143
{
144-
if (FieldMappings.TryGetValue(workItemType, out Dictionary<string, string> mappings))
144+
if (SourceFieldMappings.TryGetValue(workItemType, out Dictionary<string, string> mappings))
145145
{
146146
if (mappings.TryGetValue(sourceFieldName, out targetFieldName))
147147
{

0 commit comments

Comments
 (0)