Пример #1
0
            public void Supports_passing_args()
            {
                var er     = this.eventRaiser;
                var raised = false;
                var te4    = new TE4();

                te4.AnotherEvent += s => raised = true;

                er.Raise(
                    te4,
                    nameof(te4.AnotherEvent),
                    "asdfasdfasdy");

                Assert.True(
                    raised);

                raised      = false;
                te4.Event3 += (s, i) => raised = true;

                er.Raise(
                    te4,
                    nameof(te4.Event3),
                    "sex",
                    4);

                Assert.True(
                    raised);
            }
Пример #2
0
            public void Supports_multiple_levels_of_inheritance()
            {
                var er = this.eventRaiser;

                var raised = false;
                var te3    = new TE3();

                te3.AnEvent += () => raised = true;
                er.Raise(
                    te3,
                    nameof(te3.AnEvent));
                Assert.True(raised);

                raised = false;
                var te4 = new TE4();

                te4.AnEvent += () => raised = true;
                er.Raise(
                    te4,
                    nameof(te4.AnEvent));
                Assert.True(raised);
            }