473,392 Members | 1,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,392 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 1367
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jonathan Allen | last post by:
We have found that our method of testing does not match traditional text-book methodologies. I decided to write a short white paper on it so that I could get your opinions. Does anyone else use...
7
by: Diffident | last post by:
Hello All, Can anyone please suggest me a good unit testing tool. I have seen NUnit but not sure on how I can use it to test my methods which involve session variables, viewstate variables,...
44
by: John A. Bailo | last post by:
Dr. Dobbs has a /glowing/ article on Ruby on Rails this month. What do you guys think? Can it replace .net, php and java? And be the Open Source OOP web solution that is not bound to Sun or...
15
by: Theerasak Photha | last post by:
I wrote this for someone else to take an object and list of types, then check if obj is one of those types, raising an error otherwise. Is it enough to rely on side effects or absence thereof, or...
2
by: bytebro | last post by:
Is there any way of testing at compile time (i.e. by the preprocessor) whether a particular type has been declared? I guess what I'm looking for is something like #if defined(uint8_t) .......
3
by: John Kotuby | last post by:
I have just upgraded to a new development machine that came with Vista ultimate. I am developing a website with VS2005 and VB. My image and css references in my source code are all relative. For...
4
by: David | last post by:
Hi list. Do test-driven development or behaviour-driven development advocate how to do higher-level testing than unit testing? types of testing: unit integration system
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.