Skip to content

Commit

Permalink
test: Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Sep 2, 2024
1 parent 88875a2 commit c92efb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ public void Create_Test()

var serviceProvider = services.BuildServiceProvider();
var policyService = new PolicyService();
var logger = new NullLoggerFactory().CreateLogger<BlockChainService>();
var loggerFactory = new NullLoggerFactory();
var logger = loggerFactory.CreateLogger<BlockChainService>();
var genesisOptions = serviceProvider.GetRequiredService<IOptions<GenesisOptions>>();
var storeOptions = serviceProvider.GetRequiredService<IOptions<StoreOptions>>();
var storeService = new StoreService(storeOptions);
var blockChainService = new BlockChainService(
genesisOptions: genesisOptions,
storeOptions: storeOptions,
storeService: storeService,
policyService: policyService,
actionLoaderProviders: [],
logger: logger);
Expand All @@ -52,6 +54,8 @@ public async Task BlockAppended_TestAsync()
services.AddSingleton<IConfigureOptions<SwarmOptions>, SwarmOptionsConfigurator>();
services.AddSingleton<PolicyService>();
services.AddSingleton<BlockChainService>();
services.AddSingleton<StoreService>();
services.AddSingleton(s => (IStoreService)s.GetRequiredService<StoreService>());
var serviceProvider = services.BuildServiceProvider();
var blockChainService = serviceProvider.GetRequiredService<BlockChainService>();
var blockChain = blockChainService.BlockChain;
Expand Down
2 changes: 2 additions & 0 deletions sdk/node/Libplanet.Node.Tests/Services/NodeServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ private static ServiceCollection CreateServices()
services.AddSingleton<PolicyService>();
services.AddSingleton<IBlockChainService, BlockChainService>();
services.AddSingleton<SwarmService>();
services.AddSingleton<StoreService>();
services.AddSingleton(s => (IStoreService)s.GetRequiredService<StoreService>());
return services;
}
}

0 comments on commit c92efb0

Please sign in to comment.