public void RunIfNotLatched_CallBarWhileLatched_BarIsNotCalled() { // Arrange var classUnderTest = new FullLatch(); var foo = A.Fake <IFoo>(); // Act classUnderTest.LatchAndRun(() => classUnderTest.RunIfNotLatched(foo.Bar)); // Assert A.CallTo(() => foo.Bar()).MustNotHaveHappened(); }
public void RunIfNotLatched_GiveBar_BarIsCalled() { // Arrange var classUnderTest = new FullLatch(); var foo = A.Fake <IFoo>(); // Act classUnderTest.RunIfNotLatched(foo.Bar); // Assert A.CallTo(() => foo.Bar()).MustHaveHappened(); }