Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain McCoy <iainmc@mono-cvs.ximian.com>2005-07-30 06:02:58 +0400
committerIain McCoy <iainmc@mono-cvs.ximian.com>2005-07-30 06:02:58 +0400
commit69b9c56f55117e2df82e74369b017cc17dc82b90 (patch)
tree8be141b303638790acbbb09ecb9700cdefcdb368 /mcs/class/WindowsBase
parent64e506937a07f966d062e7d2e5e16e8b11a687d2 (diff)
2005-07-24 Iain McCoy <iain@mccoy.id.au>
* Test/AttachedProperties.cs: made LocalValueEnumerator test not depend on unstable implementation details svn path=/trunk/mcs/; revision=47851
Diffstat (limited to 'mcs/class/WindowsBase')
-rw-r--r--mcs/class/WindowsBase/ChangeLog5
-rw-r--r--mcs/class/WindowsBase/Test/AttachedProperties.cs24
2 files changed, 19 insertions, 10 deletions
diff --git a/mcs/class/WindowsBase/ChangeLog b/mcs/class/WindowsBase/ChangeLog
index e4967da5941..43fa5851942 100644
--- a/mcs/class/WindowsBase/ChangeLog
+++ b/mcs/class/WindowsBase/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-24 Iain McCoy <iain@mccoy.id.au>
+
+ * Test/AttachedProperties.cs: made LocalValueEnumerator test not
+ depend on unstable implementation details
+
2005-07-19 Iain McCoy <iain@mccoy.id.au>
* System.Windows/DependencyObject.cs,
diff --git a/mcs/class/WindowsBase/Test/AttachedProperties.cs b/mcs/class/WindowsBase/Test/AttachedProperties.cs
index 6f6119b1a67..e7b15e2b113 100644
--- a/mcs/class/WindowsBase/Test/AttachedProperties.cs
+++ b/mcs/class/WindowsBase/Test/AttachedProperties.cs
@@ -75,20 +75,24 @@ public class DependencyObjectTest {
[Test]
public void TestEnumerationOfAttachedProperties()
{
+ int count = 0;
Y y = new Y();
X.SetA(y, 2);
X.SetB(y, "Hi");
- // This test is a bit dodgy, because no guarantees are
- // made about the order in which properties and their
- // values will be returned
+
LocalValueEnumerator e = y.GetLocalValueEnumerator();
- Assert.IsTrue(e.MoveNext());
- Assert.AreEqual(e.Current.Property, X.AProperty);
- Assert.AreEqual(e.Current.Value, 2);
- Assert.IsTrue(e.MoveNext());
- Assert.AreEqual(e.Current.Property, X.BProperty);
- Assert.AreEqual(e.Current.Value, "Hi");
- Assert.IsFalse(e.MoveNext());
+ while (e.MoveNext()) {
+ count++;
+ if (e.Current.Property == X.AProperty)
+ Assert.AreEqual(e.Current.Value, 2);
+ else if (e.Current.Property == X.BProperty)
+ Assert.AreEqual(e.Current.Value, "Hi");
+ else
+ Assert.Fail("Wrong sort of property" + e.Current.Property);
+ }
+
+
+ Assert.AreEqual(2, count);
}
// An nice way to test for exceptions the class under test should