Beispiel #1
0
        public void OnConnectedOnConnectionEvent_CalledThroughEvent_RaisesEvent()
        {
            //ARRANGE
            EventArgs args = new EventArgs();

            UsbChargerSubstitute.PhoneConnected.ConnectionEvent += (sender, args) => uut.ConnectedOnConnectionEvent(new object(), args);

            bool eventRaised = false;

            uut.ConnectedConnectionEvent += (o, e) => eventRaised = true;

            //ACT
            UsbChargerSubstitute.PhoneConnected.ConnectionEvent += Raise.EventWith(new object(), args);

            //ASSERT
            Assert.That(eventRaised, Is.True);
        }