From c19731e5a5bd713ffca0bb0368351ada4ce34567 Mon Sep 17 00:00:00 2001 From: dudu Date: Wed, 14 Feb 2024 11:43:17 +0800 Subject: [PATCH] test: remove tests for BinaryFormatterTranscoder --- test/MemcachedTest/MemcachedClientTest.cs | 24 +---------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/test/MemcachedTest/MemcachedClientTest.cs b/test/MemcachedTest/MemcachedClientTest.cs index 91ef8b74..fba3b636 100755 --- a/test/MemcachedTest/MemcachedClientTest.cs +++ b/test/MemcachedTest/MemcachedClientTest.cs @@ -1,6 +1,5 @@ using Enyim.Caching; using Enyim.Caching.Memcached; -using Enyim.Caching.Memcached.Transcoders; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System; @@ -17,7 +16,7 @@ public abstract class MemcachedClientTest private static readonly ILog _log = LogManager.GetLogger(typeof(MemcachedClientTest)); public const string TestObjectKey = "Hello_World"; - protected virtual MemcachedClient GetClient(MemcachedProtocol protocol = MemcachedProtocol.Binary, bool useBinaryFormatterTranscoder = false) + protected virtual MemcachedClient GetClient(MemcachedProtocol protocol = MemcachedProtocol.Binary) { IServiceCollection services = new ServiceCollection(); services.AddEnyimMemcached(options => @@ -26,10 +25,6 @@ protected virtual MemcachedClient GetClient(MemcachedProtocol protocol = Memcach options.Protocol = protocol; // options.Transcoder = "MessagePackTranscoder"; }); - if (useBinaryFormatterTranscoder) - { - services.AddSingleton(); - } services.AddLogging(builder => builder.SetMinimumLevel(LogLevel.Warning).AddConsole()); @@ -66,11 +61,6 @@ public async Task StoreObjectTest() { Assert.True(await client.StoreAsync(StoreMode.Set, TestObjectKey, td, DateTime.Now.AddSeconds(5))); } - - using (MemcachedClient client = GetClient(MemcachedProtocol.Binary, true)) - { - Assert.True(await client.StoreAsync(StoreMode.Set, TestObjectKey, td, DateTime.Now.AddSeconds(5))); - } } [Fact] @@ -94,18 +84,6 @@ public void GetObjectTest() Assert.Equal(19810619, td2.FieldC); Assert.True(td2.FieldD, "Object was corrupted."); } - - using (MemcachedClient client = GetClient(MemcachedProtocol.Binary, true)) - { - Assert.True(client.Store(StoreMode.Set, TestObjectKey, td), "Initialization failed."); - TestData td2 = client.Get(TestObjectKey); - - Assert.NotNull(td2); - Assert.Equal("Hello", td2.FieldA); - Assert.Equal("World", td2.FieldB); - Assert.Equal(19810619, td2.FieldC); - Assert.True(td2.FieldD, "Object was corrupted."); - } } [Fact]