public void OnCommandMessageReceivedTest() { SecurityModule_Accessor target = null; try { bool eventRaised = false; target = new SecurityModule_Accessor(); target.add_CommandMessageReceived(delegate { eventRaised = true; }); CommandMessage message = new CommandMessage(); target.OnCommandMessageReceived(message); Assert.IsTrue(eventRaised); } finally { if (target != null) { target.Dispose(); } } }