Skip to content

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

@lundmikkel

Description

@lundmikkel

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestsConcerning C5.Tests

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions