public void CanSelectAndNotThrowExceptionWhenPassedIncorrectType() { int numNodes = 100; // select all of them one by one for (int i = 0; i < numNodes; i++) { CurrentDynamoModel.OnRequestSelect(this, new ModelEventArgs(null)); } }
public void TestOnRequestSelect() { //Arrange //This will subscribe our local method to the RequestNodeSelect event CurrentDynamoModel.RequestNodeSelect += CurrentDynamoModel_RequestNodeSelect; //Act //This will execute the OnRequestSelect() method CurrentDynamoModel.OnRequestSelect(this, new ModelEventArgs(null)); //Assert CurrentDynamoModel.RequestNodeSelect -= CurrentDynamoModel_RequestNodeSelect; //This will validate that the local handler was executed and set the flag in true Assert.IsTrue(requestNodeSelect); }