[MonoDevelop] First go at unit tests

Jacob Ilsø Christensen jacobilsoe at gmail.com
Fri Dec 2 04:56:33 EST 2005


Ok, I tried testing the SourceViewTextIterator class in
SourceEditorDisplayBinding.cs. The class is private and this turned out to
be quite problematic. I had to start up a lot of MD infrastructure in the
test to even get this class instantiated. This is a bad smell IMO.

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.

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? :-)

/Jacob

On 12/1/05, Jacob Ilsø Christensen <jacobilsoe at gmail.com> wrote:
>
> Ok, I'll give it a try and send the patch to the list.
>
> /Jacob
>
> On 12/1/05, Lluis Sanchez <lluis at ximian.com > wrote:
> >
> > El jue, 01-12-2005 a las 08:41 +0100, Jacob Ilsø Christensen escribió:
> >
> > >
> > > Exactly my point. The patch I added is in no way a framework. It is a
> > > small step towards adding a few tests in a specific area. And I agree
> > > that these small steps might eventually lead to some kind of
> > > framework.
> > > So. I would like to do some tests for the search thing. Is doing it
> > > the way shown in the patch the right way or not? :-)
> >
> > If you can write the tests for search in this way, I think it's a valid
> > way.
> >
> > Lluis.
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20051202/e456e03e/attachment.html


More information about the Monodevelop-list mailing list