Esempio n. 1
0
        public void Test_AccessGranted()
        {
            _testHelper.ExpectMemberResolverGetMethodInformation(_methodInfo, MemberAffiliation.Instance, _methodInformation);
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, GeneralAccessTypes.Edit, TestAccessTypes.First);
            _testHelper.ExpectObjectSecurityStrategyHasAccess(new Enum[] { GeneralAccessTypes.Edit, TestAccessTypes.First }, true);
            _testHelper.ReplayAll();

            bool hasAccess = _securityClient.HasMethodAccess(_testHelper.SecurableObject, _methodInfo);

            _testHelper.VerifyAll();
            Assert.That(hasAccess, Is.True);
        }
        public void Test_AccessGranted()
        {
            _testHelper.ExpectMemberResolverGetMethodInformation(_methodInfo, MemberAffiliation.Instance, _methodInformation);
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.First);
            _testHelper.ExpectObjectSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            _securityClient.CheckPropertyReadAccess(_testHelper.SecurableObject, _methodInfo);

            _testHelper.VerifyAll();
        }
        public void Test_AccessGranted()
        {
            _testHelper.ExpectMemberResolverGetMethodInformation("get_InstanceProperty", MemberAffiliation.Instance, _methodInformation);
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.First);

            _testHelper.ExpectObjectSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            bool hasAccess = _securityClient.HasPropertyReadAccess(_testHelper.SecurableObject, "InstanceProperty");

            _testHelper.VerifyAll();
            Assert.That(hasAccess, Is.True);
        }
        public void Test_AccessGranted()
        {
            _testHelper.ExpectMemberResolverGetMethodInformation(_methodInfo, MemberAffiliation.Static, _methodInformation);
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.First);
            _testHelper.ExpectFunctionalSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            _securityClient.CheckStaticMethodAccess(typeof(SecurableObject), _methodInfo);

            _testHelper.VerifyAll();
        }
Esempio n. 5
0
        public void Test_AccessGranted()
        {
            _testHelper.ExpectMemberResolverGetMethodInformation("InstanceMethod", MemberAffiliation.Instance, _methodInformation);
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.First);
            _testHelper.ExpectFunctionalSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            bool hasAccess = _securityClient.HasStatelessMethodAccess(typeof(SecurableObject), "InstanceMethod");

            _testHelper.VerifyAll();
            Assert.That(hasAccess, Is.True);
        }