public void Function() { Action act = () => { var result = _externalClass.Function(); ReSharper.TestValueAnalysis(result, result == null /*Expect no warning*/); }; act.ShouldNotThrow(); }
public void FunctionOnExternalClass() { Action act = () => { var result = _externalClass.Function(); ReSharper.TestValueAnalysis(result, result == null); // unknown nullability }; act.ShouldNotThrow(); }
public void FunctionOnExternalClassOverriddenInInOwnCode() { Action act = () => { var result = _derivedClassInOwnCodeAsExternalClass.Function(); ReSharper.TestValueAnalysis(result, result == null); // unknown nullability }; act.ShouldThrow <InvalidOperationException>("derived method has been rewritten although external base method is (unannotated) nullable") .WithMessage("[NullGuard] Return value * is null."); }