Skip to content

Commit b0c2acf

Browse files
committed
Fix test failure
1 parent bcc1a3c commit b0c2acf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

MemcachedTest/MemcachedClientTest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
using Microsoft.Extensions.Logging;
1010
using System.Threading.Tasks;
1111
using System.Linq;
12+
using Microsoft.Extensions.Configuration;
13+
using System.IO;
1214

1315
namespace MemcachedTest
1416
{
@@ -19,6 +21,8 @@ public abstract class MemcachedClientTest
1921

2022
protected virtual MemcachedClient GetClient(MemcachedProtocol protocol = MemcachedProtocol.Binary, bool useBinaryFormatterTranscoder = false)
2123
{
24+
var configuration = new ConfigurationBuilder().Build();
25+
2226
IServiceCollection services = new ServiceCollection();
2327
services.AddEnyimMemcached(options =>
2428
{
@@ -29,11 +33,12 @@ protected virtual MemcachedClient GetClient(MemcachedProtocol protocol = Memcach
2933
// options.Transcoder = "BinaryFormatterTranscoder";
3034
//}
3135
});
32-
if(useBinaryFormatterTranscoder)
36+
if (useBinaryFormatterTranscoder)
3337
{
34-
services.AddSingleton<ITranscoder,BinaryFormatterTranscoder>();
38+
services.AddSingleton<ITranscoder, BinaryFormatterTranscoder>();
3539
}
3640

41+
services.AddSingleton<IConfiguration>(configuration);
3742
services.AddLogging(builder => builder.SetMinimumLevel(LogLevel.Error).AddConsole());
3843

3944
IServiceProvider serviceProvider = services.BuildServiceProvider();

0 commit comments

Comments
 (0)