sestoft / C5

C5 generic collection library for C#/.NET
http://www.itu.dk/research/c5/
MIT License
1.03k stars 181 forks source link

MoveNextAfterUpdate Test Seems to be Testing the Wrong Method #46

Open lundmikkel opened 8 years ago

lundmikkel commented 8 years ago

The MoveNextAfterUpdate() test in ArrayListTest seems to contain a mistake causing it to test the wrong thing:

[Test]
public void MoveNextAfterUpdate()
{
    list.Add(5);
    list.Add(8);
    list.Add(5);

    SCG.IEnumerator<int> e = list.GetEnumerator();

    e.MoveNext();
    list.Add(99); // <-- Bug: this should be Update()
    Assert.Throws<CollectionModifiedException>(() => e.MoveNext());
}

The test checks if calling Add() makes the enumerator fail. It should probably be a call to Update() instead.

I'm not sure if this mistake has been duplicated elsewhere.

ondfisk commented 8 years ago

You're probably right. Perhaps you could make a pull request fixing these (there are a couple) Thanks