forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelWithMapAndList.cs
More file actions
42 lines (34 loc) · 940 Bytes
/
ModelWithMapAndList.cs
File metadata and controls
42 lines (34 loc) · 940 Bytes
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
using System.Collections.Generic;
using NUnit.Framework;
namespace ServiceStack.Common.Tests.Models
{
public class ModelWithMapAndList<T>
{
public ModelWithMapAndList()
{
this.Map = new Dictionary<T, T>();
this.List = new List<T>();
}
public ModelWithMapAndList(int id)
: this()
{
Id = id;
Name = "Name" + id;
}
public int Id { get; set; }
public string Name { get; set; }
public Dictionary<T, T> Map { get; set; }
public List<T> List { get; set; }
public static ModelWithMapAndList<T> Create<U>(int id)
{
return new ModelWithMapAndList<T>(id);
}
public static void AssertIsEqual(ModelWithMapAndList<T> actual, ModelWithMapAndList<T> expected)
{
Assert.That(actual.Id, Is.EqualTo(expected.Id));
Assert.That(actual.Name, Is.EqualTo(expected.Name));
Assert.That(actual.Map, Is.EquivalentTo(expected.Map));
Assert.That(actual.List, Is.EquivalentTo(expected.List));
}
}
}