public void Set_callback_via_extension_method() { var bar = Substitute.For <IBar>(); var wasCalled = false; sub.GetBar(2).Returns(bar).AndDoes(x => wasCalled = true); sub.GetBar(1); Assert.That(wasCalled, Is.False); var result = sub.GetBar(2); Assert.That(result, Is.EqualTo(bar)); Assert.That(wasCalled, Is.True); }
public static string GetBar() { return(_foo.GetBar()); }