public void ReturnsAnonymousForAnonymousSyncActionWhenDescribing()
        {
            var testee = new ArgumentLessGuardHolder(() => true);

            var description = testee.Describe();

            description
            .Should()
            .Be("anonymous");
        }
        public void ReturnsFunctionNameForNonAnonymousAsyncActionWhenDescribing()
        {
            var testee = new ArgumentLessGuardHolder(AsyncGuard);

            var description = testee.Describe();

            description
            .Should()
            .Be("AsyncGuard");
        }
        public async Task SyncActionIsInvokedWhenGuardHolderIsExecuted()
        {
            var wasExecuted = false;

            bool SyncGuard()
            {
                wasExecuted = true;
                return(true);
            }

            var testee = new ArgumentLessGuardHolder(SyncGuard);

            await testee.Execute(null);

            wasExecuted
            .Should()
            .BeTrue();
        }
        public async Task AsyncActionIsInvokedWheGuardHolderIsExecuted()
        {
            var wasExecuted = false;

            Task <bool> SyncGuard()
            {
                wasExecuted = true;
                return(Task.FromResult(true));
            }

            var testee = new ArgumentLessGuardHolder(SyncGuard);

            await testee.Execute(null);

            wasExecuted
            .Should()
            .BeTrue();
        }
        public void ActionIsInvokedWhenGuardHolderIsExecuted()
        {
            var wasExecuted = false;

            bool Guard()
            {
                wasExecuted = true;
                return(true);
            }

            var testee = new ArgumentLessGuardHolder(Guard);

            testee.Execute(null);

            wasExecuted
            .Should()
            .BeTrue();
        }