I want to put a Debug Assert into a function that I am giving to programmers so they make sure to pass the correct information into the routine when they code against it. The problem is I want my test to be able to see that the assert happens. The code in the routine will handle the invalid parameter correctly if it is compiled as is and sent to a user and the user will not get the assert because they get the released version.
What I want to do is have my tests run without the assert screen getting show while when the programmer runs it in the actual code, it gives them the assertion.
What I have done so far is:
>((i, j) => Debug.Assert(i, j));
Mock.Arrange(() => Debug.Assert(Arg.AnyBool, Arg.AnyString)).DoNothing();
The Assert screen still comes up. I am not sure what I am missing in this process. Can you guys help me out here? Is this something that is possible or do I just have to remove the assert and throw an exception instead?