public void Test_AccessGranted()
        {
            _testHelper.ExpectFunctionalSecurityStrategyHasAccess(GeneralAccessTypes.Create, true);
            _testHelper.ReplayAll();

            _securityClient.CheckConstructorAccess(typeof(SecurableObject));

            _testHelper.VerifyAll();
        }
示例#2
0
        public void Test_WithParamsArray()
        {
            _testHelper.ExpectFunctionalSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            _securityClient.CheckStatelessAccess(typeof(SecurableObject), AccessType.Get(TestAccessTypes.First));

            _testHelper.VerifyAll();
        }
示例#3
0
        public void Test_AccessGranted()
        {
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.First);
            _testHelper.ExpectFunctionalSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

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

            _testHelper.VerifyAll();
        }
示例#4
0
        public void Test_WithParamsArray()
        {
            _testHelper.ExpectFunctionalSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            bool hasAccess = _securityClient.HasStatelessAccess(typeof(SecurableObject), AccessType.Get(TestAccessTypes.First));

            _testHelper.VerifyAll();
            Assert.That(hasAccess, Is.EqualTo(true));
        }
示例#5
0
        public void Test_AccessGranted()
        {
            _testHelper.ExpectFunctionalSecurityStrategyHasAccess(GeneralAccessTypes.Create, true);
            _testHelper.ReplayAll();

            bool hasAccess = _securityClient.HasConstructorAccess(typeof(SecurableObject));

            _testHelper.VerifyAll();
            Assert.That(hasAccess, Is.True);
        }
示例#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);
        }