473,320 Members | 2,012 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,320 software developers and data experts.

How do you check to see if an object works in vs2005 standard?

I have an object i want to test before putting into real code. How do i do
that in vs 2005 standard?
Nov 30 '07 #1
9 1104
Andy,

You should probably look into a unit testing package like NUnit, as I
don't think the Standard edition has the testing tools available to it.
NUnit should integrate with VS.NET 2005. There are other unit testing
packages out there as well you could look into. Just google for them.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andy B" <a_*****@sbcglobal.netwrote in message
news:e5**************@TK2MSFTNGP05.phx.gbl...
>I have an object i want to test before putting into real code. How do i do
that in vs 2005 standard?

Nov 30 '07 #2


"Andy B" wrote:
I have an object i want to test before putting into real code. How do i do
that in vs 2005 standard?
Um, what kind of code is it in now?
Nov 30 '07 #3
what do you mean by what code is it in? the object is c# and it is supposed
to be used anywhere its needed like a website or c# program
"Family Tree Mike" <Fa************@discussions.microsoft.comwrote in
message news:DA**********************************@microsof t.com...
>

"Andy B" wrote:
>I have an object i want to test before putting into real code. How do i
do
that in vs 2005 standard?

Um, what kind of code is it in now?


Dec 1 '07 #4


"Andy B" wrote:
what do you mean by what code is it in? the object is c# and it is supposed
to be used anywhere its needed like a website or c# program

What I meant was, you said you had an object working. What I take it now to
mean is you had a csharp class (code) working. So you actually have some
test code already. I guess I was confused by this versus real code. Now it
sounds like you want a test between your development project and some
production code. Nicholas has pointed you to some options on that.

Sorry for my confusion, but I didn't want to guess at what your original
post meant.

Dec 1 '07 #5
I need to make sure that the code works right. For example, I need to take
data types, objects and classes/collections and "test" them seperately as
well as together. What I mean by testing, is to be able to take an object
inside a dll, create instances of it without any other code running and then
inspect how the code actually runs before putting it in the project. Its
like looking at a class that is running in memory all by itself so you can
see if things are going right. I have heard of something in vs2005 standard
called object test bench. Any idea what that is and how to use it?
"Family Tree Mike" <Fa************@discussions.microsoft.comwrote in
message news:33**********************************@microsof t.com...
>

"Andy B" wrote:
>what do you mean by what code is it in? the object is c# and it is
supposed
to be used anywhere its needed like a website or c# program


What I meant was, you said you had an object working. What I take it now
to
mean is you had a csharp class (code) working. So you actually have some
test code already. I guess I was confused by this versus real code. Now
it
sounds like you want a test between your development project and some
production code. Nicholas has pointed you to some options on that.

Sorry for my confusion, but I didn't want to guess at what your original
post meant.

Dec 1 '07 #6
Andy B <a_*****@sbcglobal.netwrote:
I need to make sure that the code works right. For example, I need to take
data types, objects and classes/collections and "test" them seperately as
well as together. What I mean by testing, is to be able to take an object
inside a dll, create instances of it without any other code running and then
inspect how the code actually runs before putting it in the project. Its
like looking at a class that is running in memory all by itself so you can
see if things are going right. I have heard of something in vs2005 standard
called object test bench. Any idea what that is and how to use it?
I've never used object test bench, but I *seem* to remember that it's
an ad-hoc interactive approach. Personally I far prefer the
repeatability of unit tests.

Write a test for the correct behaviour, preferably before implementing
that behaviour, and keep the test after it works. That way you'll know
if you break anything when you need to change the class for some other
reason.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Dec 1 '07 #7
How do you write a test? and where do you put it? The dll is going to be in
a website project (it is already in the solution for the website)...
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
Andy B <a_*****@sbcglobal.netwrote:
>I need to make sure that the code works right. For example, I need to
take
data types, objects and classes/collections and "test" them seperately as
well as together. What I mean by testing, is to be able to take an object
inside a dll, create instances of it without any other code running and
then
inspect how the code actually runs before putting it in the project. Its
like looking at a class that is running in memory all by itself so you
can
see if things are going right. I have heard of something in vs2005
standard
called object test bench. Any idea what that is and how to use it?

I've never used object test bench, but I *seem* to remember that it's
an ad-hoc interactive approach. Personally I far prefer the
repeatability of unit tests.

Write a test for the correct behaviour, preferably before implementing
that behaviour, and keep the test after it works. That way you'll know
if you break anything when you need to change the class for some other
reason.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Dec 1 '07 #8
Andy B <a_*****@sbcglobal.netwrote:
How do you write a test? and where do you put it? The dll is going to be in
a website project (it is already in the solution for the website)...
I personally create a separate project in the same solution, and create
tests using NUnit. Read examples etc on the nunit.org website for more
information.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Dec 1 '07 #9
"Andy B" <a_*****@sbcglobal.netwrote in
news:us**************@TK2MSFTNGP04.phx.gbl:
How do you write a test? and where do you put it? The dll is going to
be in a website project (it is already in the solution for the
website)...
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
>Andy B <a_*****@sbcglobal.netwrote:
>>I need to make sure that the code works right. For example, I need
to take
data types, objects and classes/collections and "test" them
seperately as well as together. What I mean by testing, is to be
able to take an object inside a dll, create instances of it without
any other code running and then
inspect how the code actually runs before putting it in the project.
Its like looking at a class that is running in memory all by itself
so you can
see if things are going right. I have heard of something in vs2005
standard
called object test bench. Any idea what that is and how to use it?

I've never used object test bench, but I *seem* to remember that it's
an ad-hoc interactive approach. Personally I far prefer the
repeatability of unit tests.

Write a test for the correct behaviour, preferably before
implementing that behaviour, and keep the test after it works. That
way you'll know if you break anything when you need to change the
class for some other reason.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Using either NUnit or VS Team System, a typical test would look
something like this.... (The only difference between the two are the
attributes - i'm using NUnit Attributes - but the principal is exactly
the same.)

I suggest visiting www.NUnit.org
[TestFixture]
public class MyObjectTestFixture
{
MyObject _testObj;

[SetUp]
public void Setup()
{
_testObj = new MyObject();
}

[Test]
public void
{
_testObj.Name = "foo";

string expected = "foo";
string actual = _testObj.Name;

Assert.AreEqual(expected, actual);
}
}
Dec 2 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
2
by: Mike | last post by:
I´ve got a number of SPAN elements named "mySpan1", "mySpan2", "mySpan3" etc, and want to set their "style.display" to "inline". This works (only needs to work on IE5.5+): for (var x = 1; x <...
7
by: Mike | last post by:
Hi, I have read the Microsoft Product Feature Comparisons page many times over (http://msdn.microsoft.com/vstudio/products/compare/default.aspx), as well as Gregory's blog on the subject...
6
by: tommaso.gastaldi | last post by:
Hi, does anybody know a speedy analog of IsNumeric() to check for strings/chars. I would like to check if an Object can be treated as a string before using a Cstr(), clearly avoiding the time...
15
by: Joseph Geretz | last post by:
OK, I'll admit it up front - I just don't get it. Here's our previous VS2003 development model. Developers develop the WS solution on their own workstations, using their own IIS web servers...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
8
by: cj | last post by:
In 2003 I sometimes changed the startup object of a project to Sub Main which was found in Module1.vb. I upgraded one such project to 2005 and I notice in the properties page for the project that...
3
by: =?Utf-8?B?UGF1bA==?= | last post by:
I was just wondering if anyone knows if vs2005 standard edition will work for this. I would like to build some windows applications that will have Crystal reports as an output and interface with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.