Beispiel #1
0
        public void CallCoreMethodsOnlyOnce()
        {
            var state     = new CustomSuspenderState();
            var suspender = new CustomSuspender(state);

            using (suspender.Suspend())
            {
                using (suspender.Suspend())
                {
                    using (suspender.Suspend())
                    {
                    }
                }
            }

            state.SuspendCoreCallCount.Should().Be(1);
            state.ResumeCoreCallCount.Should().Be(1);
        }
Beispiel #2
0
        public void HaveFalseStateInCoreMethods()
        {
            var state     = new CustomSuspenderState();
            var suspender = new CustomSuspender(state);

            using (suspender.Suspend())
            {
            }

            state.SuspendCoreState.Should().BeFalse();
            state.ResumeCoreState.Should().BeFalse();
        }