Files
mono/mcs/class/corlib/Test/System.Collections/DictionaryEntryTest.cs
T
Robert Jordan 29e1464833 2009-06-24 Robert Jordan <[email protected]>
* ArrayListTest.cs, CollectionBaseTest.cs, DictionaryEntryTest.cs,
	HashtableTest.cs: Convert all tests to new-style nunit methods.

	* QueueTest.cs: likewise. Convertion revealed 25 test that were
	disabled after the NUnit 2.4 update.

	* StackTest.cs: likewise. Convertion revealed 24 test that were
	disabled after the NUnit 2.4 update.


svn path=/trunk/mcs/; revision=136771
2009-06-24 14:58:20 +00:00

54 lines
1.1 KiB
C#

// DictionaryEntryTest
using System;
using System.Collections;
using NUnit.Framework;
namespace MonoTests.System.Collections {
[TestFixture]
public class DictionaryEntryTest {
[Test]
public void Ctor () {
DictionaryEntry d = new DictionaryEntry (1, "something");
Assert.IsNotNull (d);
Assert.AreEqual (1, d.Key, "#01");
Assert.AreEqual ("something", d.Value, "#02");
}
[Test]
public void Key () {
DictionaryEntry d = new DictionaryEntry (1, "something");
d.Key = 77.77;
Assert.AreEqual (77.77, d.Key, "#03");
}
[Test]
public void Value () {
DictionaryEntry d = new DictionaryEntry (1, "something");
d.Value = 'p';
Assert.AreEqual ('p', d.Value, "#04");
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentNullException))]
#endif
public void NullKeyCtor ()
{
DictionaryEntry d = new DictionaryEntry (null, "bar");
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentNullException))]
#endif
public void NullKeySetter ()
{
DictionaryEntry d = new DictionaryEntry ("foo", "bar");
d.Key = null;
}
}
}