Exemple #1
0
        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();
        }
Exemple #2
0
        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();
        }