public void ExecuteWithSecurityCheck_ViaDomainObjectParameter_WithObjectHasAccessTrue_Succeeds()
        {
            var wxeFunction = CreateWxeFunction();

            ObjectSecurityStrategyStub
            .Stub(
                stub => stub.HasAccess(
                    Arg.Is(SecurityProviderStub),
                    Arg.Is(SecurityPrincipalStub),
                    Arg <IReadOnlyList <AccessType> > .List.Equal(new[] { TestAccessTypeValue })))
            .Return(true);

            wxeFunction.Execute(Context);
        }
        public void ExecuteWithSecurityCheck_ViaDomainObjectParameter_WithObjectHasAccessFalse_Fails()
        {
            var wxeFunction = CreateWxeFunction();

            ObjectSecurityStrategyStub
            .Stub(
                stub => stub.HasAccess(
                    Arg.Is(SecurityProviderStub),
                    Arg.Is(SecurityPrincipalStub),
                    Arg <IReadOnlyList <AccessType> > .List.Equal(new[] { TestAccessTypeValue })))
            .Return(false);

            Assert.That(
                () => wxeFunction.Execute(Context),
                Throws.TypeOf <WxeUnhandledException>().With.InnerException.TypeOf <PermissionDeniedException>());
        }