public void HasAccessGranted() { _testHelper.ExpectHasStatelessAccessForWxeFunction(typeof(TestFunctionWithThisObject), true); _testHelper.ReplayAll(); bool hasAccess = _securityAdapter.HasAccess(null, new EventHandler(TestEventHandler)); _testHelper.VerifyAll(); Assert.That(hasAccess, Is.True); }
public void EvaluateTrue_FromTrueAndAccessGranted() { Expect.Call(_mockWebSecurityAdapter.HasAccess(_mockSecurableObject, new EventHandler(TestHandler))).Return(true); WebButton button = CreateButtonWithClickEventHandler(); button.Enabled = true; _mocks.ReplayAll(); bool enabled = button.Enabled; _mocks.VerifyAll(); Assert.That(enabled, Is.True); }
private bool HasAccessForEventCommand(ISecurableObject securableObject) { if (_webSecurityAdapter == null) { return(true); } return(_webSecurityAdapter.HasAccess(securableObject, Click)); }
public void HasAccessGranted_WithoutHandler() { _testHelper.ReplayAll(); bool hasAccess = _securityAdapter.HasAccess(_testHelper.CreateSecurableObject(), null); _testHelper.VerifyAll(); Assert.That(hasAccess, Is.True); }
public void ExpectWebSecurityProviderHasAccess(ISecurableObject securableObject, Delegate handler, bool returnValue) { Expect.Call(_mockWebSecurityAdapter.HasAccess(securableObject, handler)).Return(returnValue).Repeat.Once(); }