2
0
mirror of synced 2025-01-10 16:46:05 +00:00
cs-codex-dist-tests/DistTestCore/CodexNodeFactory.cs

33 lines
1.2 KiB
C#
Raw Normal View History

2023-04-13 14:36:17 +02:00
using DistTestCore.Codex;
2023-04-14 10:51:35 +02:00
using DistTestCore.Marketplace;
2023-04-13 14:36:17 +02:00
using DistTestCore.Metrics;
namespace DistTestCore
{
public interface ICodexNodeFactory
{
OnlineCodexNode CreateOnlineCodexNode(CodexAccess access, CodexNodeGroup group);
}
public class CodexNodeFactory : ICodexNodeFactory
{
private readonly TestLifecycle lifecycle;
private readonly IMetricsAccessFactory metricsAccessFactory;
2023-04-14 10:51:35 +02:00
private readonly IMarketplaceAccessFactory marketplaceAccessFactory;
2023-04-13 14:36:17 +02:00
2023-04-14 10:51:35 +02:00
public CodexNodeFactory(TestLifecycle lifecycle, IMetricsAccessFactory metricsAccessFactory, IMarketplaceAccessFactory marketplaceAccessFactory)
2023-04-13 14:36:17 +02:00
{
this.lifecycle = lifecycle;
this.metricsAccessFactory = metricsAccessFactory;
2023-04-14 10:51:35 +02:00
this.marketplaceAccessFactory = marketplaceAccessFactory;
2023-04-13 14:36:17 +02:00
}
public OnlineCodexNode CreateOnlineCodexNode(CodexAccess access, CodexNodeGroup group)
{
var metricsAccess = metricsAccessFactory.CreateMetricsAccess(access.Container);
2023-04-14 12:37:05 +02:00
var marketplaceAccess = marketplaceAccessFactory.CreateMarketplaceAccess(access);
2023-04-14 10:51:35 +02:00
return new OnlineCodexNode(lifecycle, access, group, metricsAccess, marketplaceAccess);
2023-04-13 14:36:17 +02:00
}
}
}