Exemple #1
0
        public void Test_AccessGranted()
        {
            _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.First);
            _testHelper.ExpectObjectSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            _securityClient.CheckPropertyReadAccess(_testHelper.SecurableObject, _methodInformation);

            _testHelper.VerifyAll();
        }
Exemple #2
0
        public void Test_WithParamsArray()
        {
            _testHelper.ExpectObjectSecurityStrategyHasAccess(TestAccessTypes.First, true);
            _testHelper.ReplayAll();

            bool hasAccess = _securityClient.HasAccess(_testHelper.SecurableObject, AccessType.Get(TestAccessTypes.First));

            _testHelper.VerifyAll();
            Assert.That(hasAccess, Is.EqualTo(true));
        }
Exemple #3
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);
        }