History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-12910
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Ilya Ryzhenkov
Reporter: Andriy Kozachuk
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

Generate wrappers for non-public members of classes to test

Created: 05 Aug 06 19:09   Updated: 05 May 07 04:26
Component/s: Unit Testing
Fix Version/s: Future Versions
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Old URL: http://www.intellij.net/tracker/resharper/viewSCR?publicId=12910


 Description  « Hide
One of the problems with NUnit unit tests is that it's hard to place them into separate project because unit tests must access some of the non-public members in classes being tested. Common solution is to place unit tests code together with production code and use conditional compiler directives to not compile unit tests code in release build; however, it's still more convenient to keep unit tests in separate project. InternalsVisibleToAttribute in .NET FW 2.0 partially solves this problem for internal members, but not for private ones.

VS 2005 Team Suite edition provides more convenient solution to the problem - it has feature to generate wrappers for tested classes which have the same interface as tested classes but access non-public methods using reflection. Code for wrappers is generated once and can be used in unit tests after this. This is good solution because if class interface gets changed, wrappers can be regenerated and unit tests will simply not compile - we will need to fix them; that will keep unit tests consistent.

It's known fact that only Team Suite edition of VS 2005 has unit testing framework integrated. Fortunately, ReSharper 2.0 supports integrated test run for NUnit so the problem is not that big anymore. However, it would be nice if ReSharper will include functionality to generate wrappers for tested classes as well.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.