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);
        }
Esempio n. 2
0
        public void Test_AccessGranted()
        {
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.First);
            _testHelper.ExpectObjectSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            _securityClient.CheckPropertyReadAccess(_testHelper.SecurableObject, _methodInformation);

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

            _securityClient.CheckPropertyWriteAccess(_testHelper.SecurableObject, "InstanceProperty");

            _testHelper.VerifyAll();
        }
        public void Test_AccessGranted()
        {
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.Second);
            _testHelper.ExpectObjectSecurityStrategyHasAccess(TestAccessTypes.Second, true);
            _testHelper.ReplayAll();

            bool hasAccess = _securityClient.HasPropertyWriteAccess(_testHelper.SecurableObject, _methodInformation);

            Assert.That(hasAccess, Is.True);
            _testHelper.VerifyAll();
        }
Esempio n. 5
0
        public void Test_AccessGranted()
        {
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.First);
            _testHelper.ExpectFunctionalSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

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

            _testHelper.VerifyAll();
        }
Esempio n. 6
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);
        }