Ejemplo n.º 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);
        }