public void ItemIdCollectionEnumeratorMoveNextNullObject() { tlog.Debug(tag, $"ItemIdCollectionEnumeratorMoveNextNullObject START"); uint[] itemId = new uint[] { 1, 2, 3, 4 }; global::System.Collections.ICollection c = itemId; var itemIdCollection = new ItemIdCollection(c); Assert.IsNotNull(itemIdCollection, "Should be not null!"); Assert.IsInstanceOf <ItemIdCollection>(itemIdCollection, "Should be an Instance of ItemIdCollection!"); var testingTarget = new ItemIdCollection.ItemIdCollectionEnumerator(itemIdCollection); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <ItemIdCollection.ItemIdCollectionEnumerator>(testingTarget, "Should be an Instance of ItemIdCollectionEnumerator!"); try { testingTarget.MoveNext(); testingTarget.MoveNext(); testingTarget.MoveNext(); testingTarget.MoveNext(); testingTarget.MoveNext(); var result = testingTarget.Current; } catch (InvalidOperationException e) { tlog.Debug(tag, e.Message.ToString()); testingTarget.Dispose(); tlog.Debug(tag, $"ItemIdCollectionEnumeratorMoveNextNullObject END (OK)"); Assert.Pass("Caught InvalidOperationException: Passed!"); } }
public void ItemIdCollectionEnumeratorConstructor() { tlog.Debug(tag, $"ItemIdCollectionEnumeratorConstructor START"); using (ItemIdCollection itemIdCollection = new ItemIdCollection()) { var testingTarget = new ItemIdCollection.ItemIdCollectionEnumerator(itemIdCollection); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <ItemIdCollection.ItemIdCollectionEnumerator>(testingTarget, "Should be an Instance of ItemIdCollectionEnumerator!"); testingTarget.Dispose(); } tlog.Debug(tag, $"ItemIdCollectionEnumeratorConstructor END (OK)"); }
public void ItemIdCollectionEnumeratorCurrent() { tlog.Debug(tag, $"ItemIdCollectionEnumeratorCurrent START"); using (ItemIdCollection itemCollection = new ItemIdCollection()) { var testingTarget = new ItemIdCollection.ItemIdCollectionEnumerator(itemCollection); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <ItemIdCollection.ItemIdCollectionEnumerator>(testingTarget, "Should be an Instance of ItemIdCollectionEnumerator!"); try { tlog.Debug(tag, "Current : " + testingTarget.Current); } catch (InvalidOperationException e) { tlog.Debug(tag, e.Message.ToString()); testingTarget.Dispose(); tlog.Debug(tag, $"ItemIdCollectionEnumeratorCurrent END (OK)"); Assert.Pass("Caught InvalidOperationException : passed!"); } } }