-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
Helpers.cs
56 lines (44 loc) · 1.69 KB
/
Helpers.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Collections.Specialized.Tests
{
public static class Helpers
{
public static MyNameObjectCollection CreateNameObjectCollection(int count)
{
MyNameObjectCollection nameObjectCollection = new MyNameObjectCollection();
for (int i = 0; i < count; i++)
{
nameObjectCollection.Add("Name_" + i, new Foo("Value_" + i));
}
return nameObjectCollection;
}
public static NameValueCollection CreateNameValueCollection(int count, int start = 0)
{
NameValueCollection nameValueCollection = new NameValueCollection();
for (int i = start; i < start + count; i++)
{
nameValueCollection.Add("Name_" + i, "Value_" + i);
}
return nameValueCollection;
}
public static StringDictionary CreateStringDictionary(int count)
{
StringDictionary stringDictionary = new StringDictionary();
for (int i = 0; i < count; i++)
{
stringDictionary.Add("Key_" + i, "Value_" + i);
}
return stringDictionary;
}
public static HybridDictionary CreateHybridDictionary(int count, bool caseInsensitive = false)
{
HybridDictionary hybridDictionary = new HybridDictionary(caseInsensitive);
for (int i = 0; i < count; i++)
{
hybridDictionary.Add("Key_" + i, "Value_" + i);
}
return hybridDictionary;
}
}
}