@@ -22,6 +22,10 @@ namespace NuGetUpdater.Core.Test.Run;
22
22
23
23
public class RunWorkerTests
24
24
{
25
+ public const string TestPullRequestCommitMessage = "test-pull-request-commit-message" ;
26
+ public const string TestPullRequestTitle = "test-pull-request-title" ;
27
+ public const string TestPullRequestBody = "test-pull-request-body" ;
28
+
25
29
[ Theory ]
26
30
[ InlineData ( EOLType . CR ) ]
27
31
[ InlineData ( EOLType . LF ) ]
@@ -210,9 +214,9 @@ await File.WriteAllTextAsync(projectPath, """
210
214
} ,
211
215
] ,
212
216
BaseCommitSha = "TEST-COMMIT-SHA" ,
213
- CommitMessage = "TODO: message" ,
214
- PrTitle = "TODO: title" ,
215
- PrBody = "TODO: body" ,
217
+ CommitMessage = TestPullRequestCommitMessage ,
218
+ PrTitle = TestPullRequestTitle ,
219
+ PrBody = TestPullRequestBody ,
216
220
} ,
217
221
new MarkAsProcessed ( "TEST-COMMIT-SHA" )
218
222
]
@@ -462,9 +466,9 @@ await File.WriteAllTextAsync(projectPath, """
462
466
463
467
] ,
464
468
BaseCommitSha = "TEST-COMMIT-SHA" ,
465
- CommitMessage = "TODO: message" ,
466
- PrTitle = "TODO: title" ,
467
- PrBody = "TODO: body" ,
469
+ CommitMessage = TestPullRequestCommitMessage ,
470
+ PrTitle = TestPullRequestTitle ,
471
+ PrBody = TestPullRequestBody ,
468
472
} ,
469
473
new MarkAsProcessed ( "TEST-COMMIT-SHA" )
470
474
]
@@ -856,9 +860,9 @@ await File.WriteAllTextAsync(packagesConfigPath, """
856
860
} ,
857
861
] ,
858
862
BaseCommitSha = "TEST-COMMIT-SHA" ,
859
- CommitMessage = "TODO: message" ,
860
- PrTitle = "TODO: title" ,
861
- PrBody = "TODO: body" ,
863
+ CommitMessage = TestPullRequestCommitMessage ,
864
+ PrTitle = TestPullRequestTitle ,
865
+ PrBody = TestPullRequestBody ,
862
866
} ,
863
867
new MarkAsProcessed ( "TEST-COMMIT-SHA" )
864
868
]
@@ -1416,9 +1420,9 @@ await File.WriteAllTextAsync(packagesConfigPath, """
1416
1420
} ,
1417
1421
] ,
1418
1422
BaseCommitSha = "TEST-COMMIT-SHA" ,
1419
- CommitMessage = "TODO: message" ,
1420
- PrTitle = "TODO: title" ,
1421
- PrBody = "TODO: body" ,
1423
+ CommitMessage = TestPullRequestCommitMessage ,
1424
+ PrTitle = TestPullRequestTitle ,
1425
+ PrBody = TestPullRequestBody ,
1422
1426
} ,
1423
1427
new MarkAsProcessed ( "TEST-COMMIT-SHA" )
1424
1428
]
@@ -1724,9 +1728,9 @@ await File.WriteAllTextAsync(directoryBuildPropsPath, """
1724
1728
}
1725
1729
] ,
1726
1730
BaseCommitSha = "TEST-COMMIT-SHA" ,
1727
- CommitMessage = "TODO: message" ,
1728
- PrTitle = "TODO: title" ,
1729
- PrBody = "TODO: body" ,
1731
+ CommitMessage = TestPullRequestCommitMessage ,
1732
+ PrTitle = TestPullRequestTitle ,
1733
+ PrBody = TestPullRequestBody ,
1730
1734
} ,
1731
1735
new MarkAsProcessed ( "TEST-COMMIT-SHA" )
1732
1736
]
@@ -2065,9 +2069,9 @@ await RunAsync(
2065
2069
}
2066
2070
] ,
2067
2071
BaseCommitSha = "TEST-COMMIT-SHA" ,
2068
- CommitMessage = "TODO: message" ,
2069
- PrTitle = "TODO: title" ,
2070
- PrBody = "TODO: body"
2072
+ CommitMessage = TestPullRequestCommitMessage ,
2073
+ PrTitle = TestPullRequestTitle ,
2074
+ PrBody = TestPullRequestBody
2071
2075
} ,
2072
2076
new MarkAsProcessed ( "TEST-COMMIT-SHA" )
2073
2077
]
@@ -2450,9 +2454,9 @@ await RunAsync(
2450
2454
} ,
2451
2455
] ,
2452
2456
BaseCommitSha = "TEST-COMMIT-SHA" ,
2453
- CommitMessage = "TODO: message" ,
2454
- PrTitle = "TODO: title" ,
2455
- PrBody = "TODO: body" ,
2457
+ CommitMessage = TestPullRequestCommitMessage ,
2458
+ PrTitle = TestPullRequestTitle ,
2459
+ PrBody = TestPullRequestBody ,
2456
2460
} ,
2457
2461
new MarkAsProcessed ( "TEST-COMMIT-SHA" ) ,
2458
2462
]
@@ -2593,7 +2597,16 @@ private static async Task RunAsync(Job job, TestFile[] files, IDiscoveryWorker?
2593
2597
var worker = new RunWorker ( jobId , testApiHandler , discoveryWorker , analyzeWorker , updaterWorker , logger ) ;
2594
2598
var repoContentsPathDirectoryInfo = new DirectoryInfo ( tempDirectory . DirectoryPath ) ;
2595
2599
var actualResult = await worker . RunAsync ( job , repoContentsPathDirectoryInfo , "TEST-COMMIT-SHA" ) ;
2596
- var actualApiMessages = testApiHandler . ReceivedMessages . ToArray ( ) ;
2600
+ var actualApiMessages = testApiHandler . ReceivedMessages
2601
+ . Select ( m =>
2602
+ m . Object switch
2603
+ {
2604
+ // this isn't the place to verify the generated text
2605
+ CreatePullRequest create => ( m . Type , create with { CommitMessage = TestPullRequestCommitMessage , PrTitle = TestPullRequestTitle , PrBody = TestPullRequestBody } ) ,
2606
+ UpdatePullRequest update => ( m . Type , update with { CommitMessage = TestPullRequestCommitMessage , PrTitle = TestPullRequestTitle , PrBody = TestPullRequestBody } ) ,
2607
+ _ => m ,
2608
+ }
2609
+ ) . ToArray ( ) ;
2597
2610
2598
2611
// assert
2599
2612
var actualRunResultJson = JsonSerializer . Serialize ( actualResult ) ;
0 commit comments