예제 #1
0
        public void ActionIsInvokedWhenActionHolderIsExecuted()
        {
            var wasExecuted = false;

            void AnAction() => wasExecuted = true;

            var testee = new ArgumentLessActionHolder(AnAction);

            testee.Execute(null);

            wasExecuted
            .Should()
            .BeTrue();
        }
예제 #2
0
        public async Task SyncActionIsInvokedWhenActionHolderIsExecuted()
        {
            var wasExecuted = false;

            void SyncAction() => wasExecuted = true;

            var testee = new ArgumentLessActionHolder(SyncAction);

            await testee.Execute(null);

            wasExecuted
            .Should()
            .BeTrue();
        }
예제 #3
0
        public async Task AsyncActionIsInvokedWhenActionHolderIsExecuted()
        {
            var wasExecuted = false;

            Task AsyncAction()
            {
                wasExecuted = true;
                return(Task.CompletedTask);
            }

            var testee = new ArgumentLessActionHolder(AsyncAction);

            await testee.Execute(null);

            wasExecuted
            .Should()
            .BeTrue();
        }