I have my code. I use the System.Function Debug.Assert(..) method to check the input parameter at the beginning of the method (see the following code fragment):
public class TestClass : IInterface { } public class Verifier { public static void Verify(IInterface objectToVerify) { Debug.Assert((objectToVerify is TestClass), "Passed object must be type of TestClass");
If I comment on the Debug.Assert , the ReSharper warning will disappear. In my opinion, ReSharper should ignore this Debug.Assert , because also, if the Debug.Assert statement Debug.Assert not executed, the code below is executed (for example, in Release mode)
What is your opinion? Or is there an alternative implementation idea?
source share