Skip to content

Commit 3b4939f

Browse files
Federico ColomboFederico Colombo
authored andcommitted
fix unit test
1 parent af8c3b7 commit 3b4939f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

test/CachingFramework.Redis.UnitTest/UnitTestRedis_Async.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,11 @@ public async Task UT_CacheSerializer_Async(RedisContext context)
373373
var ksby = "primitive:sbyte";
374374
var ki16 = "primitive:int16";
375375
var ki32 = "primitive:int32";
376-
var kuip = "primitive:uintptr";
377376
var kdbl = "primitive:double";
378377
var kdt = "datetime";
379378

380379
context.Cache.Remove(new[] { kss, kls, kpBool, kpInt, kpLong, kpSingle, kpUInt16, kpUInt32, kpUInt64,
381-
kch, kds, kdt, kby, ksby, ki16, ki32, kuip, kdbl });
380+
kch, kds, kdt, kby, ksby, ki16, ki32, kdbl });
382381
var ss = "this is a short string";
383382
var ls = @"UTF-8 is a character encoding capable of encoding all possible characters, or code points, in Unicode.
384383
The encoding is variable-length and uses 8-bit code units. It was designed for backward compatibility with ASCII, and to avoid the complications of endianness and byte order marks in the alternative UTF-16 and UTF-32 encodings. The name is derived from: Universal Coded Character Set + Transformation Format—8-bit.";
@@ -389,11 +388,6 @@ public async Task UT_CacheSerializer_Async(RedisContext context)
389388
await context.Cache.SetObjectAsync<SByte>(ksby, SByte.MaxValue);
390389
await context.Cache.SetObjectAsync<Int16>(ki16, Int16.MaxValue);
391390
await context.Cache.SetObjectAsync<Int32>(ki32, Int32.MaxValue);
392-
// TODO: this fails here because System.Text.Json cannot serialize UIntPtr
393-
if (context.GetSerializer().GetType() != typeof(JsonSerializer))
394-
{
395-
await context.Cache.SetObjectAsync<UIntPtr>(kuip, UIntPtr.Zero);
396-
}
397391
await context.Cache.SetObjectAsync<Double>(kdbl, Double.NegativeInfinity);
398392
await context.Cache.SetObjectAsync<bool>(kpBool, true);
399393
await context.Cache.SetObjectAsync<int>(kpInt, int.MaxValue);
@@ -425,7 +419,6 @@ public async Task UT_CacheSerializer_Async(RedisContext context)
425419
var ksby_ = context.Cache.GetObject<SByte>(ksby);
426420
var ki16_ = context.Cache.GetObject<Int16>(ki16);
427421
var ki32_ = context.Cache.GetObject<Int32>(ki32);
428-
var kuip_ = context.Cache.GetObject<UIntPtr>(kuip);
429422
var kdbl_ = context.Cache.GetObject<Double>(kdbl);
430423
var kpBool_ = context.Cache.GetObject<bool>(kpBool);
431424

@@ -438,7 +431,6 @@ public async Task UT_CacheSerializer_Async(RedisContext context)
438431
Assert.AreEqual(SByte.MaxValue, ksby_);
439432
Assert.AreEqual(Int16.MaxValue, ki16_);
440433
Assert.AreEqual(Int32.MaxValue, ki32_);
441-
Assert.AreEqual(UIntPtr.Zero, kuip_);
442434
Assert.AreEqual(Double.NegativeInfinity, kdbl_);
443435
Assert.AreEqual(int.MaxValue, pInt_);
444436
Assert.AreEqual(long.MaxValue, pLong_);
@@ -451,7 +443,7 @@ public async Task UT_CacheSerializer_Async(RedisContext context)
451443
}
452444
Assert.AreEqual(true, kpBool_);
453445
context.Cache.Remove(new[] { kss, kls, kpBool, kpInt, kpLong, kpSingle, kpUInt16, kpUInt32, kpUInt64,
454-
kch, kds, kdt, kby, ksby, ki16, ki32, kuip, kdbl });
446+
kch, kds, kdt, kby, ksby, ki16, ki32, kdbl });
455447
}
456448

457449
[Test]

0 commit comments

Comments
 (0)