Ejemplo n.º 1
0
        public void TestOnWorkspaceRemoveStarted()
        {
            //Arrange
            //This will subscribe our local method to the WorkspaceRemoveStarted event
            CurrentDynamoModel.WorkspaceRemoveStarted += CurrentDynamoModel_WorkspaceRemoveStarted;

            //Act
            //Internally this will execute the OnWorkspaceRemoveStarted() method in DynamoModelEvents
            CurrentDynamoModel.RemoveWorkspace(CurrentDynamoModel.CurrentWorkspace);

            //Assert
            CurrentDynamoModel.WorkspaceRemoveStarted -= CurrentDynamoModel_WorkspaceRemoveStarted;
            //This will validate that the local handler was executed and set the flag in true
            Assert.IsTrue(workspaceRemoveStarted);
        }