Assert.true or Assert.Pass() or Assert.Fail() are giving me expception

1,180 views
Skip to first unread message

bgakum...@gmail.com

unread,
Mar 1, 2017, 12:18:17 PM3/1/17
to NUnit-Discuss
Hi,

We are using Specflow with nunit, when a statement  Assert.Pass(); or  Assert.Fail(); is executed in feature file, it throwing an exception.

I tired with Assert.True(Var); this is executed only var is ture or else it also throwing exception.

exception is :

An exception of type 'NUnit.Framework.AssertionException' occurred in TechTalk.SpecFlow.dll but was not handled in user code

 

Additional information:   Expected: True


I am using below packages: 

NUnit.3.5.0

SpecFlow.2.1.0

SpecRun.Runner.1.5.1

SpecRun.SpecFlow.1.5.1


even with latest pacakges, I am having same problem.


regards,

AK

Charlie Poole

unread,
Mar 1, 2017, 12:34:01 PM3/1/17
to NUnit-Discuss
Assertions that fail as well as assertions like Assert.Pass that are intended to terminate execution of the test all throw exceptions. They are normally handled by NUnit itself, which records the result before going on to the next test.

My guess in this case is that the version of NUnit you are using may not match what your version of SpecFlow expects.



--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to nunit-...@googlegroups.com.
Visit this group at https://groups.google.com/group/nunit-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages