471,317 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Testing Types During Development

I'm looking for the best way to test individual methods and such during development.
I use VS2005, but am still new to .NET. I'd like to test things as I develop
without executing the entire app etc.
Thanks
Jan 7 '06 #1
6 1286
KJ
Check out NUnit at http://www.nunit.org

Jan 7 '06 #2

"Primera" <Pr*****@newsgroups.nospam> wrote in message
news:40*************************@msnews.microsoft. com...
I'm looking for the best way to test individual methods and such during
development. I use VS2005, but am still new to .NET. I'd like to test
things as I develop without executing the entire app etc.
Thanks


Use the Object Test Bench of VS2005. Right-click the type you wish to create
using the Class Designer, and from the resulting context menu select Create
Instance. It will display a dialog box that allows you to name your
temporary object variable and supply any constructor arguments if required.
Once the process is complete, you will find your object hosted within the
IDE. Right-clicking the object icon will allow you to invoke its methods.

Hope this helps,
--
csn

Jan 7 '06 #3
csharpnb <cs******@nospam.hotmail.com> wrote:
"Primera" <Pr*****@newsgroups.nospam> wrote in message
news:40*************************@msnews.microsoft. com...
I'm looking for the best way to test individual methods and such during
development. I use VS2005, but am still new to .NET. I'd like to test
things as I develop without executing the entire app etc.


Use the Object Test Bench of VS2005. Right-click the type you wish to create
using the Class Designer, and from the resulting context menu select Create
Instance. It will display a dialog box that allows you to name your
temporary object variable and supply any constructor arguments if required.
Once the process is complete, you will find your object hosted within the
IDE. Right-clicking the object icon will allow you to invoke its methods.


That lets you "play" with an object, but that's not the same as
systematically testing it. Unit tests are much better for that. I'd
second the recommendation for NUnit.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 7 '06 #4
Jon Skeet [C# MVP] wrote:
csharpnb <cs******@nospam.hotmail.com> wrote:
"Primera" <Pr*****@newsgroups.nospam> wrote in message
news:40*************************@msnews.microsof t.com...
I'm looking for the best way to test individual methods and such during
development. I use VS2005, but am still new to .NET. I'd like to test
things as I develop without executing the entire app etc.


Use the Object Test Bench of VS2005. Right-click the type you wish to create
using the Class Designer, and from the resulting context menu select Create
Instance. It will display a dialog box that allows you to name your
temporary object variable and supply any constructor arguments if required.
Once the process is complete, you will find your object hosted within the
IDE. Right-clicking the object icon will allow you to invoke its methods.

That lets you "play" with an object, but that's not the same as
systematically testing it. Unit tests are much better for that. I'd
second the recommendation for NUnit.

A second great tool is VS2005 itself. The build in unit tests in VS2005
are as good as NUnit and much better integrated into VS. You can
execute/debug single/multiple test, it can generate and (semi automatic)
maintain Test wrappers for private and internal components, etc.
However, extra functionality like NMock is not available :-(

HTH,
Andy
--
To email me directly, please remove the *NO*SPAM* parts below:
*NO*SPAM*xmen40@*NO*SPAM*gmx.net
Jan 7 '06 #5
KJ
That sounds cool. How do you do it?

Jan 7 '06 #6
Andreas Mueller <me@privacy.net> wrote:
That lets you "play" with an object, but that's not the same as
systematically testing it. Unit tests are much better for that. I'd
second the recommendation for NUnit.
A second great tool is VS2005 itself. The build in unit tests in VS2005
are as good as NUnit and much better integrated into VS. You can
execute/debug single/multiple test, it can generate and (semi automatic)
maintain Test wrappers for private and internal components, etc.
However, extra functionality like NMock is not available :-(


Just to be clear - this is only available in Team System. The "lower"
editions of VS2005 (including Professional) don't include unit testing,
unfortunately. (I've suggested to many people at Microsoft that this
should be changed.)

I haven't used the built-in version myself, but I seem to remember it
doesn't have an overall green/red bar. I know it's a little thing, but
it's a big psychological help which I'm surprised MS did away with.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 7 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jonathan Allen | last post: by
7 posts views Thread by Diffident | last post: by
44 posts views Thread by John A. Bailo | last post: by
15 posts views Thread by Theerasak Photha | last post: by
2 posts views Thread by bytebro | last post: by
3 posts views Thread by John Kotuby | last post: by
4 posts views Thread by David | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.