public void SomeDelegateWithInvokeAndBeginInvokeCalls() { Action act = () => { var someDelegate = DelegatesSample.GetSomeDelegate(); someDelegate.Invoke(null /*Expect:AssignNullToNotNullAttribute[MIn]*/); var asyncResult = someDelegate.BeginInvoke(null, null, null); // The BeginInvoke() result is made implicitly NotNull by ReSharper's CodeAnnotationsCache: TestValueAnalysis(asyncResult, asyncResult == null /*Expect:ConditionIsAlwaysTrueOrFalse*/); asyncResult.AsyncWaitHandle.WaitOne(); }; act.Should().NotThrow(BecauseDelegateMethodIsAnonymous); }
public void GetSomeDelegateToLambda() { Action act = () => DelegatesSample.GetSomeDelegate()(null /*Expect:AssignNullToNotNullAttribute[MIn]*/); act.Should().NotThrow(BecauseDelegateMethodIsAnonymous); }