/
CaseInsensitiveComparerTest.cs
50 lines (35 loc) · 1.17 KB
/
CaseInsensitiveComparerTest.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
// CaseInsensitiveComparerTest
using System;
using System.Collections;
using NUnit.Framework;
namespace MonoTests.System.Collections {
/// <summary>CaseInsensitiveComparer test suite.</summary>
public class CaseInsensitiveComparerTest : TestCase {
public static ITest Suite {
get {
return new TestSuite(typeof(CaseInsensitiveComparerTest));
}
}
public CaseInsensitiveComparerTest() : base ("MonoTests.System.Collections.CaseInsensitiveComparerTest testcase") {}
public CaseInsensitiveComparerTest(String name) : base(name)
{
}
protected override void SetUp ()
{
}
public void TestDefaultInstance ()
{
// Make sure the instance returned by Default
// is really a CaseInsensitiveComparer.
Assert((CaseInsensitiveComparer.Default
as CaseInsensitiveComparer) != null);
}
public void TestCompare () {
CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();
Assert(cic.Compare ("WILD WEST", "Wild West") == 0);
Assert(cic.Compare ("WILD WEST", "wild west") == 0);
Assert(cic.Compare ("Zeus", "Mars") > 0);
Assert(cic.Compare ("Earth", "Venus") < 0);
}
}
}