public void BuildingEventWithDelegateTypes() { var test = new TestEvent(); test.OnChange += () => _output.WriteLine("Hello"); test.Raise(); }
public void RaiseEventWithEmptyArgs() { EventArgs eventArgs = null; TestEvent += (sender, args) => eventArgs = args; TestEvent.Raise(this); Assert.That(eventArgs, Is.EqualTo(EventArgs.Empty)); }
public void EventIsRaised() { int wasCalled = 0; TestEvent += (sender, args) => wasCalled++; TestEvent.Raise(null, null); Assert.That(wasCalled, Is.EqualTo(1)); }
public void InvokeWithoutSender() { TestEvent.Raise(null, new TestEventArgs()); }
public void InvokeEvent() { TestEvent.Raise(this, new TestEventArgs()); }