[MonoDevelop] First go at unit tests
M. Scott Ford
vaderpi at scottandlaurie.com
Sat Dec 3 03:35:27 EST 2005
>>I do not think it is feasible to do it this way. So how do I go about
>>testing this class? I see a couple of options:
>>
>>* Put the test in the class.
>>* Make the class public.
>>* Move the class somewhere else.
>>
>>
>
>None of those options are acceptable.
>
>
I might be out of line, but why?
>
>
>>It ought not be so hard to unit test a search algorithm. Maybe the
>>algorithm should be moved somewhere else?
>>
>>Any good ideas out there? :-)
>>
>>
>
>I think that the best solution would be to implement a Tester add-in,
>which once loaded in MD would use the public API to test whatever needs
>to be tested.
>
>You would not directly test the SourceViewTextIterator class, but
>instead you would use the MonoDevelop.Ide.Gui.Search api, which
>internaly relies on that class.
>
>
Testing classes in isolation helps ensure that unrelated issues do not
cause failures. Otherwise, it is often hard to find the real cause of a
failure. You are essentially suggesting that the entire application be
tested as black box. Without some access to the application internals,
even this will be difficult.
More information about the Monodevelop-list
mailing list