-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathSpecifyListCount.cs
38 lines (30 loc) · 1.26 KB
/
SpecifyListCount.cs
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
using System.Collections.Generic;
namespace Tynamix.ObjectFiller.Test
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
public class SimpleList
{
public List<string> Strings10 { get; set; }
public ICollection<string> Strings2050 { get; set; }
public string[] Strings50100 { get; set; }
public int Item { get; set; }
}
[TestClass]
public class TestSpecifyListCount
{
[TestMethod]
public void Generate10Strings()
{
Filler<SimpleList> filler = new Filler<SimpleList>();
filler.Setup()
.OnProperty(x => x.Strings10).Use(new Collectionizer<string, CityName>(1,10))
.OnProperty(x => x.Strings2050).Use(new Collectionizer<string, StreetName>(20, 50))
.OnProperty(x => x.Strings50100).Use(new Collectionizer<string, RealNames>(50, 100))
.OnProperty(x => x.Item).Use(1);
var result = filler.Create();
Assert.IsTrue(result.Strings10.Count > 0 && result.Strings10.Count <= 10);
Assert.IsTrue(result.Strings2050.Count >= 20 && result.Strings2050.Count <= 50);
Assert.IsTrue(result.Strings50100.Length >= 50 && result.Strings50100.Length <= 100);
}
}
}