\r
/// <summary>Hashtable test.</summary>\r
[TestFixture]\r
-public class HashtableTest : Assertion {\r
+public class HashtableTest {\r
\r
[Test]\r
public void TestCtor1() {\r
Hashtable h = new Hashtable();\r
- AssertNotNull("No hash table", h);\r
+ Assert.IsNotNull (h, "No hash table");\r
}\r
\r
[Test]\r
} catch (ArgumentNullException) {\r
errorThrown = true;\r
}\r
- Assert("null hashtable error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
}\r
{\r
string[] keys = {"this", "is", "a", "test"};\r
}\r
Hashtable h2 = new Hashtable(h1);\r
for (int i = 0; i < keys.Length; i++) {\r
- AssertEquals("No match for key " + keys[i],\r
- values[i], h2[keys[i]]);\r
+ Assert.AreEqual (values[i], h2[keys[i]], "No match for key " + keys[i]);\r
}\r
}\r
}\r
// tests if negative capacity throws exception\r
try {\r
Hashtable ht = new Hashtable (-10, 0.1f, null, null);\r
- Assert("must throw ArgumentOutOfRange exception, param: capacity", false);\r
+ Assert.Fail ("must throw ArgumentOutOfRange exception, param: capacity");\r
} catch (ArgumentOutOfRangeException e) {\r
- Assert("ParamName is not capacity", e.ParamName == "capacity");\r
+ Assert.IsTrue (e.ParamName == "capacity", "ParamName is not capacity");\r
}\r
\r
// tests if loadFactor out of range throws exception (low)\r
try {\r
Hashtable ht = new Hashtable (100, 0.01f, null, null);\r
- Assert("must throw ArgumentOutOfRange exception, param: loadFactor, too low value", false);\r
+ Assert.Fail ("must throw ArgumentOutOfRange exception, param: loadFactor, too low value");\r
} catch (ArgumentOutOfRangeException e) \r
{\r
- Assert("ParamName is not loadFactor",e.ParamName == "loadFactor");\r
+ Assert.IsTrue (e.ParamName == "loadFactor", "ParamName is not loadFactor");\r
}\r
\r
// tests if loadFactor out of range throws exception (high)\r
try \r
{\r
Hashtable ht = new Hashtable (100, 2f, null, null);\r
- Assert("must throw ArgumentOutOfRange exception, param: loadFactor, too high value", false);\r
+ Assert.Fail ("must throw ArgumentOutOfRange exception, param: loadFactor, too high value");\r
} \r
catch (ArgumentOutOfRangeException e) \r
{\r
- Assert("ParamName is not loadFactor", e.ParamName == "loadFactor");\r
+ Assert.IsTrue (e.ParamName == "loadFactor", "ParamName is not loadFactor");\r
}\r
\r
}\r
[Test] \r
public void TestCount() {\r
Hashtable h = new Hashtable();\r
- AssertEquals("new table - count zero", 0, h.Count);\r
+ Assert.AreEqual (0, h.Count, "new table - count zero");\r
int max = 100;\r
for (int i = 1; i <= max; i++) {\r
h[i] = i;\r
- AssertEquals("Count wrong for " + i,\r
- i, h.Count);\r
+ Assert.AreEqual (i, h.Count, "Count wrong for " + i);\r
}\r
for (int i = 1; i <= max; i++) {\r
h[i] = i * 2;\r
- AssertEquals("Count shouldn't change at " + i,\r
- max, h.Count);\r
+ Assert.AreEqual (max, h.Count, "Count shouldn't change at " + i);\r
}\r
}\r
\r
[Test] \r
public void TestIsFixedSize() {\r
Hashtable h = new Hashtable();\r
- AssertEquals("hashtable not fixed by default",\r
- false, h.IsFixedSize);\r
+ Assert.AreEqual (false, h.IsFixedSize, "hashtable not fixed by default");\r
// TODO - any way to get a fixed-size hashtable?\r
}\r
\r
public void TestIsReadOnly() {\r
Hashtable h = new Hashtable();\r
- AssertEquals("hashtable not read-only by default",\r
- false, h.IsReadOnly);\r
+ Assert.AreEqual (false, h.IsReadOnly, "hashtable not read-only by default");\r
// TODO - any way to get a read-only hashtable?\r
}\r
\r
public void TestIsSynchronized ()\r
{\r
Hashtable h = new Hashtable ();\r
- Assert ("hashtable not synched by default", !h.IsSynchronized);\r
+ Assert.IsTrue (!h.IsSynchronized, "hashtable not synched by default");\r
\r
Hashtable h2 = Hashtable.Synchronized (h);\r
- Assert ("hashtable should by synched", h2.IsSynchronized);\r
+ Assert.IsTrue (h2.IsSynchronized, "hashtable should by synched");\r
\r
Hashtable h3 = (Hashtable) h2.Clone ();\r
- Assert ("Cloned Hashtable should by synched", h3.IsSynchronized);\r
+ Assert.IsTrue (h3.IsSynchronized, "Cloned Hashtable should by synched");\r
}\r
\r
[Test]\r
Object o = h[null];\r
} catch (ArgumentNullException e) {\r
errorThrown = true;\r
- AssertEquals("ParamName is not \"key\"", "key", e.ParamName);\r
+ Assert.AreEqual ("key", e.ParamName, "ParamName is not \"key\"");\r
}\r
- Assert("null hashtable error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
}\r
// TODO - if read-only and/or fixed-size is possible,\r
// test 'NotSupportedException' here\r
int max = 100;\r
for (int i = 1; i <= max; i++) {\r
h[i] = i;\r
- AssertEquals("value wrong for " + i,\r
- i, h[i]);\r
+ Assert.AreEqual (i, h[i], "value wrong for " + i);\r
}\r
}\r
}\r
for (int i = 0; i < keys.Length; i++) {\r
h1[keys[i]] = values1[i];\r
}\r
- AssertEquals("keys wrong size",\r
- keys.Length, h1.Keys.Count);\r
+ Assert.AreEqual (keys.Length, h1.Keys.Count, "keys wrong size");\r
for (int i = 0; i < keys.Length; i++) {\r
h1[keys[i]] = values2[i];\r
}\r
- AssertEquals("keys wrong size 2",\r
- keys.Length, h1.Keys.Count);\r
+ Assert.AreEqual (keys.Length, h1.Keys.Count, "keys wrong size 2");\r
\r
// MS .NET Always returns the same reference when calling Keys property\r
keysReference = h1.Keys;\r
keysReference2 = h1.Keys;\r
- AssertEquals("keys references differ", keysReference, keysReference2);\r
+ Assert.AreEqual (keysReference, keysReference2, "keys references differ");\r
\r
for (int i = 0; i < keys2.Length; i++) \r
{\r
h1[keys2[i]] = values2[i];\r
}\r
- AssertEquals("keys wrong size 3",\r
- keys.Length+keys2.Length, h1.Keys.Count);\r
- AssertEquals("keys wrong size 4",\r
- keys.Length+keys2.Length, keysReference.Count);\r
+ Assert.AreEqual (keys.Length+keys2.Length, h1.Keys.Count, "keys wrong size 3");\r
+ Assert.AreEqual (keys.Length+keys2.Length, keysReference.Count, "keys wrong size 4");\r
}\r
\r
// TODO - SyncRoot\r
for (int i = 0; i < keys.Length; i++) {\r
h1[keys[i]] = values1[i];\r
}\r
- AssertEquals("values wrong size",\r
- keys.Length, h1.Values.Count);\r
+ Assert.AreEqual (keys.Length, h1.Values.Count, "values wrong size");\r
for (int i = 0; i < keys.Length; i++) {\r
h1[keys[i]] = values2[i];\r
}\r
- AssertEquals("values wrong size 2",\r
- keys.Length, h1.Values.Count);\r
+ Assert.AreEqual (keys.Length, h1.Values.Count, "values wrong size 2");\r
\r
// MS .NET Always returns the same reference when calling Values property\r
ICollection valuesReference1 = h1.Values;\r
ICollection valuesReference2 = h1.Values;\r
- AssertEquals("values references differ", valuesReference1, valuesReference2);\r
+ Assert.AreEqual (valuesReference1, valuesReference2, "values references differ");\r
}\r
\r
[Test]\r
h.Add(null, "huh?");\r
} catch (ArgumentNullException e) {\r
errorThrown = true;\r
- AssertEquals("ParamName is not 'key'", "key", e.ParamName);\r
+ Assert.AreEqual ("key", e.ParamName, "ParamName is not 'key'");\r
}\r
- Assert("null add error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "null add error not thrown");\r
}\r
{\r
bool errorThrown = false;\r
} catch (ArgumentException) {\r
errorThrown = true;\r
}\r
- Assert("re-add error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "re-add error not thrown");\r
}\r
// TODO - hit NotSupportedException\r
{\r
int max = 100;\r
for (int i = 1; i <= max; i++) {\r
h.Add(i, i);\r
- AssertEquals("value wrong for " + i,\r
- i, h[i]);\r
+ Assert.AreEqual (i, h[i], "value wrong for " + i);\r
}\r
}\r
}\r
public void TestClear() {\r
// TODO - hit NotSupportedException\r
Hashtable h = new Hashtable();\r
- AssertEquals("new table - count zero", 0, h.Count);\r
+ Assert.AreEqual (0, h.Count, "new table - count zero");\r
int max = 100;\r
for (int i = 1; i <= max; i++) {\r
h[i] = i;\r
}\r
- Assert("table don't gots stuff", h.Count > 0);\r
+ Assert.IsTrue (h.Count > 0, "table don't gots stuff");\r
h.Clear();\r
- AssertEquals("Table should be cleared",\r
- 0, h.Count);\r
+ Assert.AreEqual (0, h.Count, "Table should be cleared");\r
}\r
\r
#if NET_2_0\r
h1[c1[i]] = c2[i];\r
}\r
Hashtable h2 = (Hashtable)h1.Clone();\r
- AssertNotNull("got no clone!", h2);\r
- AssertNotNull("clone's got nothing!", h2[c1[0]]);\r
+ Assert.IsNotNull (h2, "got no clone!");\r
+ Assert.IsNotNull (h2[c1[0]], "clone's got nothing!");\r
for (int i = 0; i < c1.Length; i++) {\r
- AssertEquals("Hashtable match", \r
- h1[c1[i]], h2[c1[i]]);\r
+ Assert.AreEqual (h1[c1[i]], h2[c1[i]], "Hashtable match");\r
}\r
}\r
{\r
h1[c1[i]] = c2[i];\r
}\r
Hashtable h2 = (Hashtable)h1.Clone();\r
- AssertNotNull("got no clone!", h2);\r
- AssertNotNull("clone's got nothing!", h2[c1[0]]);\r
+ Assert.IsNotNull (h2, "got no clone!");\r
+ Assert.IsNotNull (h2[c1[0]], "clone's got nothing!");\r
for (int i = 0; i < c1.Length; i++) {\r
- AssertEquals("Hashtable match", \r
- h1[c1[i]], h2[c1[i]]);\r
+ Assert.AreEqual (h1[c1[i]], h2[c1[i]], "Hashtable match");\r
}\r
\r
((char[])h1[c1[0]])[0] = 'z';\r
- AssertEquals("shallow copy", h1[c1[0]], h2[c1[0]]);\r
+ Assert.AreEqual (h1[c1[0]], h2[c1[0]], "shallow copy");\r
\r
#if NET_2_0\r
// NET 2.0 stuff\r
Hashtable mh1clone = (Hashtable) mh1.Clone ();\r
\r
// warning, depends on the field name.\r
- AssertEquals ("EqualityComparer",\r
- GetEqualityComparer (mh1),\r
- GetEqualityComparer (mh1clone));\r
+ Assert.AreEqual (GetEqualityComparer (mh1), GetEqualityComparer (mh1clone), "EqualityComparer");\r
#endif\r
}\r
}\r
bool result = h.Contains(null);\r
} catch (ArgumentNullException e) {\r
errorThrown = true;\r
- AssertEquals("ParamName is not 'key'", "key", e.ParamName);\r
+ Assert.AreEqual ("key", e.ParamName, "ParamName is not 'key'");\r
}\r
- Assert("null add error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "null add error not thrown");\r
}\r
{\r
Hashtable h = new Hashtable();\r
}\r
for (int i = 0; i < 10000; i += 2) \r
{\r
- Assert("hashtable must contain"+i.ToString(), h.Contains(i));\r
- Assert("hashtable does not contain "+((int)(i+1)).ToString(), !h.Contains(i+1));\r
+ Assert.IsTrue (h.Contains(i), "hashtable must contain"+i.ToString());\r
+ Assert.IsTrue (!h.Contains(i+1), "hashtable does not contain "+((int)(i+1)).ToString());\r
}\r
}\r
}\r
catch (ArgumentNullException e) \r
{\r
errorThrown = true;\r
- AssertEquals("ParamName is not 'key'", "key", e.ParamName);\r
+ Assert.AreEqual ("key", e.ParamName, "ParamName is not 'key'");\r
}\r
- Assert("null add error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "null add error not thrown");\r
}\r
{\r
Hashtable h = new Hashtable();\r
}\r
for (int i = 0; i < 1000; i += 2) \r
{\r
- Assert("hashtable must contain"+i.ToString(), h.Contains(i));\r
- Assert("hashtable does not contain "+((int)(i+1)).ToString(), !h.Contains(i+1));\r
+ Assert.IsTrue (h.Contains(i), "hashtable must contain"+i.ToString());\r
+ Assert.IsTrue (!h.Contains(i+1), "hashtable does not contain "+((int)(i+1)).ToString());\r
}\r
}\r
\r
{\r
Hashtable h = new Hashtable();\r
h['a'] = "blue";\r
- Assert("blue? it's in there!", \r
- h.ContainsValue("blue"));\r
- Assert("green? no way!", \r
- !h.ContainsValue("green"));\r
- Assert("null? no way!", \r
- !h.ContainsValue(null));\r
+ Assert.IsTrue (h.ContainsValue("blue"), "blue? it's in there!");\r
+ Assert.IsTrue (!h.ContainsValue("green"), "green? no way!");\r
+ Assert.IsTrue (!h.ContainsValue(null), "null? no way!");\r
h['b'] = null;\r
- Assert("null? it's in there!", \r
- h.ContainsValue(null));\r
+ Assert.IsTrue (h.ContainsValue(null), "null? it's in there!");\r
\r
}\r
}\r
h.CopyTo(null, 0);\r
} catch (ArgumentNullException e) {\r
errorThrown = true;\r
- AssertEquals("ParamName is not \"array\"", "array", e.ParamName); \r
+ Assert.AreEqual ("array", e.ParamName, "ParamName is not \"array\""); \r
}\r
- Assert("null hashtable error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
}\r
{\r
bool errorThrown = false;\r
h.CopyTo(o, -1);\r
} catch (ArgumentOutOfRangeException e) {\r
errorThrown = true;\r
- AssertEquals("ParamName is not \"arrayIndex\"", "arrayIndex", e.ParamName);\r
+ Assert.AreEqual ("arrayIndex", e.ParamName, "ParamName is not \"arrayIndex\"");\r
}\r
- Assert("out of range error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "out of range error not thrown");\r
}\r
{\r
bool errorThrown = false;\r
} catch (ArgumentException) {\r
errorThrown = true;\r
}\r
- Assert("multi-dim array error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "multi-dim array error not thrown");\r
}\r
{\r
bool errorThrown = false;\r
} catch (ArgumentException) {\r
errorThrown = true;\r
}\r
- Assert("no room in array error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "no room in array error not thrown");\r
}\r
{\r
bool errorThrown = false;\r
} catch (ArgumentException) {\r
errorThrown = true;\r
}\r
- Assert("table too big error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "table too big error not thrown");\r
}\r
{\r
bool errorThrown = false;\r
} catch (InvalidCastException) {\r
errorThrown = true;\r
}\r
- Assert("invalid cast error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "invalid cast error not thrown");\r
}\r
\r
{\r
o[1] = v;\r
}\r
#endif // TARGET_JVM\r
- AssertEquals("first copy fine.", 'a', o[0].Key);\r
- AssertEquals("first copy fine.", 1, o[0].Value);\r
- AssertEquals("second copy fine.", 'b', o[1].Key);\r
- AssertEquals("second copy fine.", 2, o[1].Value);\r
+ Assert.AreEqual ('a', o[0].Key, "first copy fine.");\r
+ Assert.AreEqual (1, o[0].Value, "first copy fine.");\r
+ Assert.AreEqual ('b', o[1].Key, "second copy fine.");\r
+ Assert.AreEqual (2, o[1].Value, "second copy fine.");\r
}\r
}\r
\r
h1[s1[i]] = c1[i];\r
}\r
IDictionaryEnumerator en = h1.GetEnumerator();\r
- AssertNotNull("No enumerator", en);\r
+ Assert.IsNotNull (en, "No enumerator");\r
\r
for (int i = 0; i < s1.Length; i++) {\r
en.MoveNext();\r
- Assert("Not enumerating for " + en.Key, \r
- Array.IndexOf(s1, en.Key) >= 0);\r
- Assert("Not enumerating for " + en.Value, \r
- Array.IndexOf(c1, en.Value) >= 0);\r
+ Assert.IsTrue (Array.IndexOf(s1, en.Key) >= 0, "Not enumerating for " + en.Key);\r
+ Assert.IsTrue (Array.IndexOf(c1, en.Value) >= 0, "Not enumerating for " + en.Value);\r
}\r
}\r
\r
\r
bool result;\r
foreach (DictionaryEntry de in table1)\r
- AssertEquals (de.Value, table2 [de.Key]);\r
+ Assert.AreEqual (table2 [de.Key], de.Value);\r
}\r
\r
[Test]\r
formatter.Serialize(stream, table);\r
stream.Position = 0;\r
table = (Hashtable) formatter.Deserialize(stream);\r
- AssertEquals ("#1", 1, table.Count);\r
+ Assert.AreEqual (1, table.Count, "#1");\r
}\r
\r
[Test] \r
h.Remove(null);\r
} catch (ArgumentNullException e) {\r
errorThrown = true;\r
- AssertEquals("ParamName is not \"key\"", "key", e.ParamName);\r
+ Assert.AreEqual ("key", e.ParamName, "ParamName is not \"key\"");\r
}\r
- Assert("null hashtable error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
}\r
{\r
string[] keys = {"this", "is", "a", "test"};\r
for (int i = 0; i < keys.Length; i++) {\r
h[keys[i]] = values[i];\r
}\r
- AssertEquals("not enough in table",\r
- 4, h.Count);\r
+ Assert.AreEqual (4, h.Count, "not enough in table");\r
h.Remove("huh?");\r
- AssertEquals("not enough in table",\r
- 4, h.Count);\r
+ Assert.AreEqual (4, h.Count, "not enough in table");\r
h.Remove("this");\r
- AssertEquals("Wrong count in table",\r
- 3, h.Count);\r
+ Assert.AreEqual (3, h.Count, "Wrong count in table");\r
h.Remove("this");\r
- AssertEquals("Wrong count in table",\r
- 3, h.Count);\r
+ Assert.AreEqual (3, h.Count, "Wrong count in table");\r
}\r
}\r
\r
Hashtable h = Hashtable.Synchronized(null);\r
} catch (ArgumentNullException e) {\r
errorThrown = true;\r
- AssertEquals("ParamName is not \"table\"", "table", e.ParamName);\r
+ Assert.AreEqual ("table", e.ParamName, "ParamName is not \"table\"");\r
}\r
- Assert("null hashtable error not thrown", \r
- errorThrown);\r
+ Assert.IsTrue (errorThrown, "null hashtable error not thrown");\r
}\r
{\r
Hashtable h = new Hashtable();\r
- Assert("hashtable not synced by default", \r
- !h.IsSynchronized);\r
+ Assert.IsTrue (!h.IsSynchronized, "hashtable not synced by default");\r
Hashtable h2 = Hashtable.Synchronized(h);\r
- Assert("hashtable should by synced", \r
- h2.IsSynchronized);\r
+ Assert.IsTrue (h2.IsSynchronized, "hashtable should by synced");\r
}\r
}\r
\r
[Test]\r
public void TestAddRemoveClear() {\r
ht.Clear();\r
- Assert(ht.Count==0);\r
+ Assert.IsTrue (ht.Count==0);\r
\r
SetDefaultData();\r
- Assert(ht.Count==3);\r
+ Assert.IsTrue (ht.Count==3);\r
\r
bool thrown=false;\r
try {\r
ht.Add("k2","cool");\r
} catch (ArgumentException) {thrown=true;}\r
- Assert("Must throw ArgumentException!",thrown);\r
+ Assert.IsTrue (thrown, "Must throw ArgumentException!");\r
\r
ht["k2"]="cool";\r
- Assert(ht.Count==3);\r
- Assert(ht["k2"].Equals("cool"));\r
+ Assert.IsTrue (ht.Count==3);\r
+ Assert.IsTrue (ht["k2"].Equals("cool"));\r
\r
}\r
\r
SetDefaultData();\r
Object[] entries=new Object[ht.Count];\r
ht.CopyTo(entries,0);\r
- Assert("Not an entry.",entries[0] is DictionaryEntry);\r
+ Assert.IsTrue (entries[0] is DictionaryEntry, "Not an entry.");\r
}\r
\r
[Test]\r
public void CopyTo_Empty ()\r
{\r
Hashtable ht = new Hashtable ();\r
- AssertEquals ("Count", 0, ht.Count);\r
+ Assert.AreEqual (0, ht.Count, "Count");\r
object[] array = new object [ht.Count];\r
ht.CopyTo (array, 0);\r
}\r
}\r
}\r
\r
- Assert(ht.Count==n);\r
+ Assert.IsTrue (ht.Count==n);\r
\r
for (int i=0;i<n;i++) {\r
String key=cache[i];\r
String val=ht[key] as String;\r
String err="ht[\""+key+"\"]=\""+val+\r
"\", expected \""+cache[i+max]+"\"";\r
- Assert(err,val!=null && val.Equals(cache[i+max]));\r
+ Assert.IsTrue (val!=null && val.Equals(cache[i+max]), err);\r
}\r
\r
int r1=(n/3);\r
\r
for (int i=0;i<n;i++) {\r
if (i>=r1 && i<r2) {\r
- Assert(ht[cache[i]]==null);\r
+ Assert.IsTrue (ht[cache[i]]==null);\r
} else {\r
String key=cache[i];\r
String val=ht[key] as String;\r
String err="ht[\""+key+"\"]=\""+val+\r
"\", expected \""+cache[i+max]+"\"";\r
- Assert(err,val!=null && val.Equals(cache[i+max]));\r
+ Assert.IsTrue (val!=null && val.Equals(cache[i+max]), err);\r
}\r
}\r
\r
ICollection keys=ht.Keys;\r
int nKeys=0;\r
foreach (Object key in keys) {\r
- Assert((key as String) != null);\r
+ Assert.IsTrue ((key as String) != null);\r
nKeys++;\r
}\r
- Assert(nKeys==ht.Count);\r
+ Assert.IsTrue (nKeys==ht.Count);\r
\r
\r
ICollection vals=ht.Values;\r
int nVals=0;\r
foreach (Object val in vals) {\r
- Assert((val as String) != null);\r
+ Assert.IsTrue ((val as String) != null);\r
nVals++;\r
}\r
- Assert(nVals==ht.Count);\r
+ Assert.IsTrue (nVals==ht.Count);\r
\r
}\r
\r
Hashtable ciHashtable = new Hashtable(11,1.0f,CaseInsensitiveHashCodeProvider.Default,CaseInsensitiveComparer.Default);\r
ciHashtable ["key1"] = "value";\r
ciHashtable ["key2"] = "VALUE";\r
- Assert(ciHashtable ["key1"].Equals ("value"));\r
- Assert(ciHashtable ["key2"].Equals ("VALUE"));\r
+ Assert.IsTrue (ciHashtable ["key1"].Equals ("value"));\r
+ Assert.IsTrue (ciHashtable ["key2"].Equals ("VALUE"));\r
\r
ciHashtable ["KEY1"] = "new_value";\r
- Assert(ciHashtable ["key1"].Equals ("new_value"));\r
+ Assert.IsTrue (ciHashtable ["key1"].Equals ("new_value"));\r
\r
}\r
\r
\r
Hashtable htCopy = new Hashtable (ht);\r
\r
- Assert(ht.Count == htCopy.Count);\r
+ Assert.IsTrue (ht.Count == htCopy.Count);\r
}\r
\r
[Test]\r
\r
while (e.MoveNext ()) {}\r
\r
- Assert (!e.MoveNext ());\r
+ Assert.IsTrue (!e.MoveNext ());\r
\r
}\r
\r
{\r
Hashtable ht = new Hashtable ();\r
// see bug #76300\r
- Assert ("Keys.IsSerializable", ht.Keys.GetType ().IsSerializable);\r
- Assert ("Values.IsSerializable", ht.Values.GetType ().IsSerializable);\r
- Assert ("GetEnumerator.IsSerializable", ht.GetEnumerator ().GetType ().IsSerializable);\r
- Assert ("Synchronized.IsSerializable", Hashtable.Synchronized (ht).GetType ().IsSerializable);\r
+ Assert.IsTrue (ht.Keys.GetType ().IsSerializable, "Keys.IsSerializable");\r
+ Assert.IsTrue (ht.Values.GetType ().IsSerializable, "Values.IsSerializable");\r
+ Assert.IsTrue (ht.GetEnumerator ().GetType ().IsSerializable, "GetEnumerator.IsSerializable");\r
+ Assert.IsTrue (Hashtable.Synchronized (ht).GetType ().IsSerializable, "Synchronized.IsSerializable");\r
}\r
\r
[Test]\r