public void TestOnRefreshCompleted() { //Arrange //This will subscribe our local method to the RefreshCompleted event CurrentDynamoModel.RefreshCompleted += CurrentDynamoModel_RefreshCompleted; //Act CurrentDynamoModel.OnRefreshCompleted(CurrentDynamoModel.CurrentWorkspace, new EventArgs()); //Assert CurrentDynamoModel.RefreshCompleted -= CurrentDynamoModel_RefreshCompleted; //This will validate that the local handler was executed and set the flag in true Assert.IsTrue(refreshCompleted); }