Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -6,6 +6,7 @@ using StellaOps.Microservice;
|
||||
using StellaOps.Router.Common.Models;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Microservice.Tests;
|
||||
|
||||
/// <summary>
|
||||
@@ -33,7 +34,8 @@ public class EndpointDiscoveryServiceTests
|
||||
_logger);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void DiscoverEndpoints_CallsDiscoveryProvider()
|
||||
{
|
||||
var codeEndpoints = new List<EndpointDescriptor>();
|
||||
@@ -49,7 +51,8 @@ public class EndpointDiscoveryServiceTests
|
||||
_discoveryProviderMock.Verify(x => x.DiscoverEndpoints(), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void DiscoverEndpoints_CallsYamlLoader()
|
||||
{
|
||||
var codeEndpoints = new List<EndpointDescriptor>();
|
||||
@@ -65,7 +68,8 @@ public class EndpointDiscoveryServiceTests
|
||||
_yamlLoaderMock.Verify(x => x.Load(), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void DiscoverEndpoints_PassesCodeEndpointsAndYamlConfigToMerger()
|
||||
{
|
||||
var codeEndpoints = new List<EndpointDescriptor>
|
||||
@@ -95,7 +99,8 @@ public class EndpointDiscoveryServiceTests
|
||||
_mergerMock.Verify(x => x.Merge(codeEndpoints, yamlConfig), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void DiscoverEndpoints_ReturnsMergedEndpoints()
|
||||
{
|
||||
var codeEndpoints = new List<EndpointDescriptor>
|
||||
@@ -119,7 +124,8 @@ public class EndpointDiscoveryServiceTests
|
||||
result.Should().BeSameAs(mergedEndpoints);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void DiscoverEndpoints_ContinuesWithNullYamlConfig_WhenLoaderReturnsNull()
|
||||
{
|
||||
var codeEndpoints = new List<EndpointDescriptor>
|
||||
@@ -143,7 +149,8 @@ public class EndpointDiscoveryServiceTests
|
||||
result.Should().BeSameAs(codeEndpoints);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void DiscoverEndpoints_ContinuesWithNullYamlConfig_WhenLoaderThrows()
|
||||
{
|
||||
var codeEndpoints = new List<EndpointDescriptor>
|
||||
|
||||
Reference in New Issue
Block a user