新增 Redis 哈希表测试方法
新增 `CheckHashTest` 方法,创建 Redis 哈希表并进行基本操作和断言,确保哈希表非空并对键 "0" 进行赋值。
This commit is contained in:
parent
d48f549a1e
commit
eb3ca711d3
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue