2
2
{
3
3
using System ;
4
4
using System . Collections . Generic ;
5
+ using System . Text . RegularExpressions ;
5
6
using System . Threading . Tasks ;
6
7
7
8
using FluentAssertions ;
@@ -174,7 +175,7 @@ public async Task ProcessCatalogYamlAsync_ShouldAddTagsFromRepository_WhenTagsAr
174
175
await catalogManager . ProcessCatalogYamlAsync ( repoName ) ;
175
176
176
177
// Assert
177
- mockFileSystem . Verify ( fs => fs . File . WriteAllText ( catalogFilePath , It . Is < string > ( s => s . Contains ( $ "tags:{ Environment . NewLine } - newTag") ) ) , Times . Once ) ;
178
+ mockFileSystem . Verify ( fs => fs . File . WriteAllText ( catalogFilePath , It . Is < string > ( s => Regex . IsMatch ( s , @ "tags:\s*(?:-\s*\S+\s*)*-\s* newTag", RegexOptions . Multiline ) ) ) , Times . Once ) ;
178
179
}
179
180
180
181
[ TestMethod ]
@@ -230,8 +231,8 @@ public async Task ProcessCatalogYamlAsync_ShouldUseExistingShortDescription_When
230
231
[ TestMethod ]
231
232
public async Task ProcessCatalogYamlAsync_ShouldInferTypeFromRepositoryName_WhenNoTypeIsDefined ( )
232
233
{
233
- // Arrange{ "DISMACRO", "dismacro" },
234
- var repoName = "SLC-DISMACRO -testRepo" ;
234
+ // **SC**: `Scripted Connector`
235
+ var repoName = "SLC-SC -testRepo" ;
235
236
var yamlContent = "id: testId\n short_description: test description\n tags: [testTag]" ;
236
237
mockFileSystem . Setup ( fs => fs . File . Exists ( catalogFilePath ) ) . Returns ( true ) ; // catalog.yml exists
237
238
mockFileSystem . Setup ( fs => fs . File . ReadAllText ( catalogFilePath ) ) . Returns ( yamlContent ) ;
@@ -240,7 +241,7 @@ public async Task ProcessCatalogYamlAsync_ShouldInferTypeFromRepositoryName_When
240
241
await catalogManager . ProcessCatalogYamlAsync ( repoName ) ;
241
242
242
243
// Assert
243
- mockFileSystem . Verify ( fs => fs . File . WriteAllText ( catalogFilePath , It . Is < string > ( s => s . Contains ( "type: dismacro " ) ) ) , Times . Once ) ;
244
+ mockFileSystem . Verify ( fs => fs . File . WriteAllText ( catalogFilePath , It . Is < string > ( s => s . Contains ( "type: Scripted Connector " ) ) ) , Times . Once ) ;
244
245
}
245
246
246
247
[ TestMethod ]
@@ -434,7 +435,7 @@ public async Task CheckType_ShouldInferTypeFromMultipleTopicsCorrectly()
434
435
await catalogManager . ProcessCatalogYamlAsync ( repoName ) ;
435
436
436
437
// Assert
437
- mockFileSystem . Verify ( fs => fs . File . WriteAllText ( catalogFilePath , It . Is < string > ( s => s . Contains ( "type: adhocdatasource " ) ) ) , Times . Once ) ;
438
+ mockFileSystem . Verify ( fs => fs . File . WriteAllText ( catalogFilePath , It . Is < string > ( s => s . Contains ( "type: Ad Hoc Data Source " ) ) ) , Times . Once ) ;
438
439
}
439
440
440
441
[ TestMethod ]
0 commit comments