Skip to content

Commit a98f6bc

Browse files
Fixes Regression Tests to handle the introduced breaking changes.
Several types are no longer supported.
1 parent bfa36fe commit a98f6bc

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

CICD.Tools.GitHubToCatalogYamlTests/CatalogManagerTests.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
using System;
44
using System.Collections.Generic;
5+
using System.Text.RegularExpressions;
56
using System.Threading.Tasks;
67

78
using FluentAssertions;
@@ -174,7 +175,7 @@ public async Task ProcessCatalogYamlAsync_ShouldAddTagsFromRepository_WhenTagsAr
174175
await catalogManager.ProcessCatalogYamlAsync(repoName);
175176

176177
// 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);
178179
}
179180

180181
[TestMethod]
@@ -230,8 +231,8 @@ public async Task ProcessCatalogYamlAsync_ShouldUseExistingShortDescription_When
230231
[TestMethod]
231232
public async Task ProcessCatalogYamlAsync_ShouldInferTypeFromRepositoryName_WhenNoTypeIsDefined()
232233
{
233-
// Arrange{ "DISMACRO", "dismacro" },
234-
var repoName = "SLC-DISMACRO-testRepo";
234+
// **SC**: `Scripted Connector`
235+
var repoName = "SLC-SC-testRepo";
235236
var yamlContent = "id: testId\nshort_description: test description\ntags: [testTag]";
236237
mockFileSystem.Setup(fs => fs.File.Exists(catalogFilePath)).Returns(true); // catalog.yml exists
237238
mockFileSystem.Setup(fs => fs.File.ReadAllText(catalogFilePath)).Returns(yamlContent);
@@ -240,7 +241,7 @@ public async Task ProcessCatalogYamlAsync_ShouldInferTypeFromRepositoryName_When
240241
await catalogManager.ProcessCatalogYamlAsync(repoName);
241242

242243
// 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);
244245
}
245246

246247
[TestMethod]
@@ -434,7 +435,7 @@ public async Task CheckType_ShouldInferTypeFromMultipleTopicsCorrectly()
434435
await catalogManager.ProcessCatalogYamlAsync(repoName);
435436

436437
// 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);
438439
}
439440

440441
[TestMethod]

CICD.Tools.GitHubToCatalogYamlTests/CleanTitleTests.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
public class CleanTitleTests
99
{
1010
[TestMethod]
11-
[DataRow("SkylineCommunications/SLC-AS-MediaOps-Apps", "MediaOps-Apps", "automationscript")]
12-
[DataRow("SLC-AS-MediaOps-Apps", "MediaOps-Apps", "automationscript")]
13-
[DataRow("SkylineCommunications/PCKTV-AS-RegressionTests", "RegressionTests", "automationscript")]
14-
[DataRow("SkylineCommunications/RBM-AS-Playout", "Playout", "automationscript")]
15-
[DataRow("SkylineCommunications/SLC-Doc-Vodafone-Deutschland-GmbH", "Vodafone-Deutschland-GmbH", "documentation")]
16-
[DataRow("SkylineCommunications/FOXA-GQIDS-GetAppearTVData", "GetAppearTVData", "adhocdatasource")]
17-
[DataRow("SkylineCommunications/YLE-C-Avid-iNewsOrder-Ingest", "Avid-iNewsOrder-Ingest", "connector")]
11+
[DataRow("SkylineCommunications/SLC-AS-MediaOps-Apps", "MediaOps-Apps", "Automation")]
12+
[DataRow("SLC-AS-MediaOps-Apps", "MediaOps-Apps", "Automation")]
13+
[DataRow("SkylineCommunications/PCKTV-AS-RegressionTests", "RegressionTests", "Automation")]
14+
[DataRow("SkylineCommunications/RBM-AS-Playout", "Playout", "Automation")]
15+
[DataRow("SkylineCommunications/SLC-Doc-Vodafone-Deutschland-GmbH", "Vodafone-Deutschland-GmbH", "Custom Solution")]
16+
[DataRow("SkylineCommunications/FOXA-GQIDS-GetAppearTVData", "GetAppearTVData", "Ad Hoc Data Source")]
17+
[DataRow("SkylineCommunications/YLE-C-Avid-iNewsOrder-Ingest", "Avid-iNewsOrder-Ingest", "Connector")]
1818
[DataRow("SkylineCommunications/ngx-dwa-theme-creation-helper", "ngx-dwa-theme-creation-helper", null)]
1919
public void CleanTitleTestHappy(string input, string expectedTitle, string expectedType)
2020
{

Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml/CatalogYaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class CatalogYaml
7272
" - Standard Solution: If the Catalog item is a DataMiner Solution that is an out-of-the-box solution for a specific use case or application.\r\n" +
7373
" - System Health: If the Catalog item is intended to monitor the health of a system.\r\n" +
7474
" - User-Defined API: If the Catalog item is a DataMiner Automation script designed as a user-defined API.\r\n" +
75-
" - Visual Overview: If the Catalog item is a Microsoft Visio design.\r\n" +
75+
" - Visual Overview: If the Catalog item is a Microsoft Visio design.\r\n";
7676

7777
/// <summary>
7878
/// Initializes a new instance of the <see cref="CatalogYaml"/> class.

0 commit comments

Comments
 (0)