1 // CaseInsensitiveHashCodeProviderTest
\r
4 using System.Collections;
\r
6 using NUnit.Framework;
\r
10 namespace MonoTests.System.Collections {
\r
13 /// <summary>CaseInsensitiveHashCodeProvider test suite.</summary>
\r
14 public class CaseInsensitiveHashCodeProviderTest : TestCase {
\r
15 protected override void SetUp ()
\r
19 public void TestDefaultInstance ()
\r
21 // Make sure the instance returned by Default
\r
22 // is really a CaseInsensitiveHashCodeProvider.
\r
23 Assert((CaseInsensitiveHashCodeProvider.Default
\r
24 as CaseInsensitiveHashCodeProvider) != null);
\r
27 public void TestHashCode () {
\r
28 CaseInsensitiveHashCodeProvider cih = new CaseInsensitiveHashCodeProvider ();
\r
29 int h1 = cih.GetHashCode ("Test String");
\r
30 int h2 = cih.GetHashCode ("test string");
\r
31 int h3 = cih.GetHashCode ("TEST STRING");
\r
33 Assert("Mixed Case != lower case", h1 == h2);
\r
34 Assert("Mixed Case != UPPER CASE", h1 == h3);
\r
36 h1 = cih.GetHashCode ("one");
\r
37 h2 = cih.GetHashCode ("another");
\r
38 // Actually this is quite possible.
\r