Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Tests Means that Only Added Events are Tested #44

Open
lundmikkel opened this issue Mar 22, 2016 · 1 comment
Open

Bug in Tests Means that Only Added Events are Tested #44

lundmikkel opened this issue Mar 22, 2016 · 1 comment
Labels
bug Something isn't working tests Concerning C5.Tests

Comments

@lundmikkel
Copy link
Contributor

In ArrayListTest events are not properly tested. The method listen() only adds event handlers to the Added event, thereby ignoring all other events:

private void listen() {
    seen.Listen(list, EventTypeEnum.Added);
}

This is correctly done in the HashedArrayListTest class:

private void listen() {
    seen.Listen(list, EventTypeEnum.All);
}

Be aware that fixing the listen() method will cause the Listenable() test to fail. It can, however, easily be fixed by inlining the method:

[Test]
public void Listenable()
{
    Assert.AreEqual(EventTypeEnum.All, list.ListenableEvents);
    Assert.AreEqual(EventTypeEnum.None, list.ActiveEvents);
    seen.Listen(list, EventTypeEnum.Added); // <-- Bug fix
    Assert.AreEqual(EventTypeEnum.Added, list.ActiveEvents);
}
@ondfisk
Copy link
Collaborator

ondfisk commented Apr 13, 2016

Again. Pull requests are accepted :)

@JnxF JnxF added bug Something isn't working tests Concerning C5.Tests labels Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tests Concerning C5.Tests
Projects
None yet
Development

No branches or pull requests

3 participants