Beispiel #1
0
    public void test_trigger()
    {
        var instance = new TestCollection();
        var countA   = 0;
        var countB   = 0;

        instance.AddEventHandler <TestEventA>((gp) => { countA += 1; });
        instance.AddEventHandler <TestEventB>((gp) => { countB += 1; });

        instance.Trigger(new TestEventA());
        instance.Trigger(new TestEventA());
        instance.Trigger(new TestEventB());
        instance.Trigger(new TestEventB());
        instance.Trigger(new TestEventA());

        Assert(countA == 3);
        Assert(countB == 2);
    }