logo       

Re: Use of ExpectedExceptionAttribute class in unit tests: msg#00076

windows.dotnet.nunit.devel

Subject: Re: Use of ExpectedExceptionAttribute class in unit tests

On 12/21/05, Charlie Poole <cpoole@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Glad to have your help. That said, the ExpectedCOMException sounds very
> expressive, which is an important user consideration. ExpectedException with
> an HResult attribute might do it as well. An attribute that pointed to a
> validation interface could be a bit harder to use. We have to balance
> generality against ease of use.
>

The last implementation I submitted was not using any interfaces. It
just uses reflection to get the property by name, and to compare it's
value to the expected value provided, either by regex string, or as an
object. It was something like:
[ExpectedException(type exceptionType, string propertyName, object
expectedValue)]
and
[ExpectedException(type exceptionType, string propertyName, string regEx)]

and last - the existing 2 definitions, so no code will break:
ExpectedException(type) and ExpectedException(type, string) - for message.

So looks like ExpectedCOMException will fit in such a frame.

Anyway, I'll wait for some draft doc, so I can try to reimplement all
this to fit in the new model, and to to change the existing internals
of ExpectedException.

Cheers

--
Svetoslav Milenov (Sunny)


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise