forked from ServiceStack/ServiceStack.Redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedisClientListTestExtra.cs
More file actions
59 lines (46 loc) · 1.59 KB
/
Copy pathRedisClientListTestExtra.cs
File metadata and controls
59 lines (46 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using NUnit.Framework;
using ServiceStack.Common.Extensions;
using ServiceStack.Common.Tests.Models;
using ServiceStack.Redis.Generic;
using ServiceStack.Redis.Tests.Support;
using ServiceStack.Text;
namespace ServiceStack.Redis.Tests.Generic
{
[TestFixture]
public class RedisClientListTestExtra
{
const string ListId = "testlist";
const string ListId2 = "testlist2";
private IRedisList<CustomType> List;
private IRedisList<CustomType> List2;
private readonly IModelFactory<CustomType> factory = new CustomTypeFactory();
protected IModelFactory<CustomType> Factory { get { return factory; } }
private RedisClient client;
private IRedisTypedClient<CustomType> redis;
[SetUp]
public void SetUp()
{
if (client != null)
{
client.Dispose();
client = null;
}
client = new RedisClient(TestConfig.SingleHost);
client.FlushAll();
redis = client.GetTypedClient<CustomType>();
List = redis.Lists[ListId];
List2 = redis.Lists[ListId2];
}
[Test]
public void Can_Remove_value_from_IList()
{
var storeMembers = Factory.CreateList();
storeMembers.ForEach(List.Add);
var equalItem = new CustomType() { CustomId = 4 };
storeMembers.Remove(equalItem);
List.Remove(equalItem);
var members = List.ToList<CustomType>();
Factory.AssertListsAreEqual(members, storeMembers);
}
}
}