Implement in-process multi-dataset sync isolation across core, network, persistence, and tests
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m14s
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m14s
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ZB.MOM.WW.CBDDC.Core.Network;
|
||||
using ZB.MOM.WW.CBDDC.Core.Storage;
|
||||
|
||||
namespace ZB.MOM.WW.CBDDC.Network.Tests;
|
||||
|
||||
public class MultiDatasetRegistrationTests
|
||||
{
|
||||
[Fact]
|
||||
public void AddCBDDCMultiDataset_ShouldRegisterCoordinatorAndReplaceSyncOrchestrator()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
|
||||
services.AddCBDDCNetwork<TestPeerNodeConfigurationProvider>(useHostedService: false);
|
||||
services.AddCBDDCMultiDataset(options =>
|
||||
{
|
||||
options.EnableMultiDatasetSync = true;
|
||||
options.EnableDatasetPrimary = true;
|
||||
options.EnableDatasetLogs = true;
|
||||
options.EnableDatasetTimeseries = true;
|
||||
});
|
||||
|
||||
services.Any(descriptor => descriptor.ServiceType == typeof(IMultiDatasetSyncOrchestrator)).ShouldBeTrue();
|
||||
|
||||
var syncDescriptor = services.Last(descriptor => descriptor.ServiceType == typeof(ISyncOrchestrator));
|
||||
syncDescriptor.ImplementationFactory.ShouldNotBeNull();
|
||||
}
|
||||
|
||||
private sealed class TestPeerNodeConfigurationProvider : IPeerNodeConfigurationProvider
|
||||
{
|
||||
public event PeerNodeConfigurationChangedEventHandler? ConfigurationChanged
|
||||
{
|
||||
add { }
|
||||
remove { }
|
||||
}
|
||||
|
||||
public Task<PeerNodeConfiguration> GetConfiguration()
|
||||
{
|
||||
return Task.FromResult(new PeerNodeConfiguration
|
||||
{
|
||||
NodeId = "node-test",
|
||||
TcpPort = 9000,
|
||||
AuthToken = "auth"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user