新增 Redis 哈希表测试方法

新增 `CheckHashTest` 方法,创建 Redis 哈希表并进行基本操作和断言,确保哈希表非空并对键 "0" 进行赋值。
This commit is contained in:
猿人易 2025-03-07 17:24:46 +08:00
parent d48f549a1e
commit eb3ca711d3
1 changed files with 15 additions and 0 deletions

View File

@ -1,6 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Runtime.Intrinsics.Arm;
using NewLife.Caching; using NewLife.Caching;
using NewLife.Log; using NewLife.Log;
using Xunit; using Xunit;
@ -93,6 +96,18 @@ public class HashTest
Assert.Equal(org5, hash["org5"]); Assert.Equal(org5, hash["org5"]);
} }
[Fact]
public void CheckHashTest()
{
var key = $"NewLife:eventinfo:adsfasdfasdfdsaf";
var hash = _redis.GetDictionary<EventInfo>(key);
Assert.NotNull(hash);
var l = hash as RedisHash<String, String>;
l["0"] = "0";
}
} }
public class HashTest2 : HashTest public class HashTest2 : HashTest