Exemplo n.º 1
0
        public void OnConnectedOnDisconnectionEvent_CalledThroughEvent_RaisesEvent()
        {
            //ARRANGE
            EventArgs args = new EventArgs();

            UsbChargerSubstitute.PhoneConnected.DisconnectionEvent += (sender, args) => uut.ConnectedOnDisconnectionEvent(new object(), args);

            bool eventRaised = false;

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

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

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