Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

48 lines
946 B
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]
public void NullKeyCtor ()
{
DictionaryEntry d = new DictionaryEntry (null, "bar");
}
[Test]
public void NullKeySetter ()
{
DictionaryEntry d = new DictionaryEntry ("foo", "bar");
d.Key = null;
}
}
}