public void TestOnRequestsCrashPrompt() { //Arrange //This will subscribe our local method to the RequestsCrashPrompt event CurrentDynamoModel.RequestsCrashPrompt += CurrentDynamoModel_RequestsCrashPrompt; var crashArgs = new Dynamo.Core.CrashPromptArgs("Crash Event", "Test Message"); //Act CurrentDynamoModel.OnRequestsCrashPrompt(this, crashArgs); //Assert //Unsubcribe from event CurrentDynamoModel.RequestsCrashPrompt -= CurrentDynamoModel_RequestsCrashPrompt; //This will validate that the local handler was executed and set the flag in true Assert.IsTrue(requestsCrashPrompt); }
private void CurrentDynamoModel_RequestsCrashPrompt(object sender, Dynamo.Core.CrashPromptArgs e) { requestsCrashPrompt = true; }