mirror of
https://github.com/claunia/plist-cil.git
synced 2025-12-16 19:14:26 +00:00
Merge pull request #7 from quamotion/fixes/nsarray-recursion
Fix recursive call in NSArray.GetEnumerator
This commit is contained in:
@@ -69,5 +69,28 @@ namespace plistcil.test
|
|||||||
|
|
||||||
Assert.AreEqual(0, array.Count);
|
Assert.AreEqual(0, array.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tests the <see cref="NSArray.GetEnumerator"/> method.
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void EnumeratorTest()
|
||||||
|
{
|
||||||
|
NSArray array = new NSArray();
|
||||||
|
array.Add(0);
|
||||||
|
array.Add(1);
|
||||||
|
|
||||||
|
var enumerator = array.GetEnumerator();
|
||||||
|
|
||||||
|
Assert.IsNull(enumerator.Current);
|
||||||
|
|
||||||
|
Assert.IsTrue(enumerator.MoveNext());
|
||||||
|
Assert.AreEqual(new NSNumber(0), enumerator.Current);
|
||||||
|
|
||||||
|
Assert.IsTrue(enumerator.MoveNext());
|
||||||
|
Assert.AreEqual(new NSNumber(1), enumerator.Current);
|
||||||
|
|
||||||
|
Assert.IsFalse(enumerator.MoveNext());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace Claunia.PropertyList
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IEnumerator<NSObject> GetEnumerator()
|
public IEnumerator<NSObject> GetEnumerator()
|
||||||
{
|
{
|
||||||
return this.GetEnumerator();
|
return this.array.GetEnumerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int IndexOf(object item)
|
public int IndexOf(object item)
|
||||||
|
|||||||
Reference in New Issue
Block a user