DynamoDS / RevitTestFramework

Unit Testing on Revit
124 stars 81 forks source link

Refactor and test #10

Closed ikeough closed 10 years ago

ikeough commented 10 years ago

This pull requests refactors the RTF Runner class to make it more testable. It also reduces redundant logic between the GUI and the Console applications for RTF by moving logic that is similar in both applications into the Runner itself. Runner's public methods are now reduced to the following:

SetupTests()

This method uses a supplied assembly, category, fixture, or test data object to setup tests for running. In this phase, journal files are generated, the RTF addin is generated, and the system's addins are copied to the working directory.

RunAllTests()

This method uses the test dictionary created during the setup phase to run all tests.

Refresh()

This method is used when the runner is required to clear its collections and re-read assembly data from a new assembly.

Cleanup()

This method is called when testing is complete and journal and addin files need to be removed.

Tests are added and a mock of IAssemblyData is used to test various setup cases.

@Randy-Ma PTAL

Randy-Ma commented 10 years ago

@ikeough

Thanks for the work! The intention and structure are quite clear. The code looks pretty good! There are several places which I do not understand quite well and have given comments. I am waiting for your input. I hope this can help me understand the code better.