コード例 #1
0
        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);
        }
コード例 #2
0
 private void CurrentDynamoModel_RequestsCrashPrompt(object sender, Dynamo.Core.CrashPromptArgs e)
 {
     requestsCrashPrompt = true;
 }