From eb3ca711d3d7594630b10aaf294b7c0690af4370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=BF=E4=BA=BA=E6=98=93?= Date: Fri, 7 Mar 2025 17:24:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20Redis=20=E5=93=88=E5=B8=8C?= =?UTF-8?q?=E8=A1=A8=E6=B5=8B=E8=AF=95=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 `CheckHashTest` 方法,创建 Redis 哈希表并进行基本操作和断言,确保哈希表非空并对键 "0" 进行赋值。 --- XUnitTest/HashTest.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/XUnitTest/HashTest.cs b/XUnitTest/HashTest.cs index de766db..88cb531 100644 --- a/XUnitTest/HashTest.cs +++ b/XUnitTest/HashTest.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; +using System.Runtime.Intrinsics.Arm; + using NewLife.Caching; using NewLife.Log; using Xunit; @@ -93,6 +96,18 @@ public class HashTest Assert.Equal(org5, hash["org5"]); } + + [Fact] + public void CheckHashTest() + { + var key = $"NewLife:eventinfo:adsfasdfasdfdsaf"; + + var hash = _redis.GetDictionary(key); + Assert.NotNull(hash); + + var l = hash as RedisHash; + l["0"] = "0"; + } } public class HashTest2 : HashTest