tags:

views:

78

answers:

2

I am executing If statement based on some vales but Nunit executes all statements even if the condition is false

+1  A: 

NUnit is written entirely in C#, if statements do work in C#! :)

It must be a mistake in your implementation or interpretation.

Joe R
A: 

Nunit doesn't actually evaluate your statements, it simply instantiates your tests and runs them. I would suggest that you install TestDriven.NET, if you haven't already, and use the right-click test runner in your test to run it with the debugger. Set some breakpoints in your code and look at the values that will be evaluated for the if statement. I expect, with @Joe90, that the error is in your code, not Nunit.

tvanfosson