> I don't understand your question. Assert.Fail() always fails, by
> definition. Every time you hit that line of code, you'll get an exception.
>
> Why are you surprised that that happens?
>> I don't understand your question. Assert.Fail() always fails, by
>> definition. Every time you hit that line of code, you'll get an
[quoted text clipped - 5 lines]
> rather
> that the exception isn't handled...
Sigh. Can you at least see how a subject of "Assertion fails" and
comments in your original post like "my assertions...fail in every case"
were counter-productive with respect to describing your problem?
> Normally I don't have to handle the
> AssertFailedException by myself.
What do you mean "normally"? In what situation do you not have to handle
the exception yourself?
> I think the problem is caused that the
> method is called in the event handler (WorkflowCompleted).
It certainly could be. It depends on how the event handler is being
executed.
Presumably there's some aspect about the question that is specific to this
"test for a workflow", and since I'm not familiar with the use of
"workflow" in the context of .NET, I don't fully understand the question.
Frankly, at this point I would recommend that you start a whole new
thread, and put a subject that actually describes what the issue is,
including the specific area of .NET in which you're working (i.e. assuming
"workflow" has a specific meaning here, be very specific in your subject
about the fact that you're using this "workflow", and make sure you use
the precise terminology/type/etc. that .NET would use).
As things stand now, the few people who might understand the context of
"workflow" may well have just skipped past the thread, because there's
nothing immediately visible in the thread that would alert them to the
fact that it's something they might know something about.
Finally, given the apparent esoteric nature of the question, you should
probably post a concise-but-complete code sample that reliably
demonstrates the problem. The sample should demonstrate both the case
that works as you expect, as well as the case that doesn't.
Pete
Armin Galliker - 25 Apr 2008 08:48 GMT
Hi Pete
I apologize for my unclear question. You're absolutely right. Nevertheless,
I thank you for your comments. As you recommended I've opened a new thread:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?&lang=en&cr=U
S&guid=&sloc=en-us&dg=microsoft.public.dotnet.languages.csharp&p=1&tid=936cd268-
b3b2-4d1d-ac69-c04863b02e6f&mid=936cd268-b3b2-4d1d-ac69-c04863b02e6f
Armin