473,396 Members | 1,666 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,396 software developers and data experts.

Exception in test cases

We are new to using the Tests in VS 2005, and they are really great,
but we are having a problem with them in regards to exceptions. Any
many cases when we are debugging code we would like unhandled
exceptions to pause execution where the exception occurs, rather than
the test end right there. Is there a way to have tests operate in this
way?

Sep 14 '06 #1
2 2113
Are you talking about debugging (stepping through) the code? or running
the unit tests in a unit testing tool?

If you are talking about Unit testing, then there really is no way that
I know of the break out of the unit test and pause, this kind of goes
against the whole idea of unit testing where you run your tests and see
if they pass or fail.

I make additional tests that expect an exception to test exceptions.
Unhandled exceptions should cause a test to fail as your assert
statement wont evaluate.

Could you be a little more specific?

Thanks

Sean

sh******@cs.fsu.edu wrote:
We are new to using the Tests in VS 2005, and they are really great,
but we are having a problem with them in regards to exceptions. Any
many cases when we are debugging code we would like unhandled
exceptions to pause execution where the exception occurs, rather than
the test end right there. Is there a way to have tests operate in this
way?
Sep 14 '06 #2
Thanks Sean.

I am referring to debugging. I understand what you mean about the
purpose of unit testing and how that functions in terms of pass/fail.
Although we find it very handy for debugging DLL code, since it allows
us to run individual functions and step through the code. But if an
exception is encountered, the test ends immidietely, and I can't
examine the state of relevant variables to determine the cause of the
exception.
-Aaron
Sean Chambers wrote:
Are you talking about debugging (stepping through) the code? or running
the unit tests in a unit testing tool?

If you are talking about Unit testing, then there really is no way that
I know of the break out of the unit test and pause, this kind of goes
against the whole idea of unit testing where you run your tests and see
if they pass or fail.

I make additional tests that expect an exception to test exceptions.
Unhandled exceptions should cause a test to fail as your assert
statement wont evaluate.

Could you be a little more specific?

Thanks

Sean

sh******@cs.fsu.edu wrote:
We are new to using the Tests in VS 2005, and they are really great,
but we are having a problem with them in regards to exceptions. Any
many cases when we are debugging code we would like unhandled
exceptions to pause execution where the exception occurs, rather than
the test end right there. Is there a way to have tests operate in this
way?
Sep 19 '06 #3

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

Similar topics

9
by: Kevin Goodsell | last post by:
If I'm writing a class that will be used as an exception, what kinds of things do I need to watch out for? For example, is it necessary to make sure that the members of the class don't throw? ...
28
by: Frank Puck | last post by:
Meanwhile there are at least 8 years that compilers exist, which provide a working implementation of C++ Exception Handling. Has anything changed meanwhile? From my point of view nothing has...
10
by: linq936 | last post by:
Hi, I have many assert() call in my code, now I am considering to replace them with exception. The reason I want to do this change is that with the program going bigger and bigger, it is hard to...
9
by: C# Learner | last post by:
Some time ago, I remember reading a discussion about the strengths and weaknesses of exception handling. One of the weaknesses that was put forward was that exception handling is inefficient (in...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
15
by: David | last post by:
Hi, I have built a web application that will be a very high profile application. We had tested it, demonstrated it and shown that it all works. On a dress rehearsal run through, it failed...
2
by: Tim Reynolds | last post by:
Team, When my web service throws an exception and I am debugging on my PC - I get the exception back in my browser fine. My web.config shows <customErrors mode="Off"/> and this is working well. ...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
17
by: Cramer | last post by:
I plan to implement an exception logging feature in an ASP.NET Web application that writes encountered exceptions to disk. The exception data will be stored as XML. I am planning on having each...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.