Beispiel #1
0
 public Command(CommandType defaultType, [CanBeNull] IWebSecurityAdapter webSecurityAdapter, [CanBeNull] IWxeSecurityAdapter wxeSecurityAdapter)
 {
     _defaultType        = defaultType;
     _type               = _defaultType;
     _webSecurityAdapter = webSecurityAdapter;
     _wxeSecurityAdapter = wxeSecurityAdapter;
 }
 public void Setup()
 {
     _mocks = new MockRepository();
     _mockWebSecurityAdapter = _mocks.StrictMock <IWebSecurityAdapter> ();
     _mockSecurableObject    = _mocks.StrictMock <ISecurableObject> ();
     _mockCommand            = _mocks.StrictMock <Command> (CommandType.None, _mockWebSecurityAdapter, (IWxeSecurityAdapter)null);
 }
Beispiel #3
0
 public NavigationCommand(
     CommandType defaultType,
     [CanBeNull] IWebSecurityAdapter webSecurityAdapter,
     [CanBeNull] IWxeSecurityAdapter wxeSecurityAdapter)
     : base(defaultType, webSecurityAdapter, wxeSecurityAdapter)
 {
 }
Beispiel #4
0
        public Command CreateHrefCommand(IWebSecurityAdapter webSecurityAdapter = null, IWxeSecurityAdapter wxeSecurityAdapter = null)
        {
            Command command = new Command(CommandType.Href, webSecurityAdapter, wxeSecurityAdapter);

            InitializeHrefCommand(command);

            return(command);
        }
 public BocMenuItemCommand(
     CommandType defaultType,
     [CanBeNull] IWebSecurityAdapter webSecurityAdapter,
     [CanBeNull] IWxeSecurityAdapter wxeSecurityAdapter)
     : base(defaultType, webSecurityAdapter, wxeSecurityAdapter)
 {
     _hrefCommand        = new MenuItemHrefCommandInfo();
     _wxeFunctionCommand = new MenuItemWxeFunctionCommandInfo();
 }
Beispiel #6
0
        public Command CreateNoneCommand(IWebSecurityAdapter webSecurityAdapter = null, IWxeSecurityAdapter wxeSecurityAdapter = null)
        {
            Command command = new Command(CommandType.None, webSecurityAdapter, wxeSecurityAdapter);

            command.OwnerControl = CreateOwnerControl();
            InitializeNoneCommand(command);

            return(command);
        }
        public void SetUp()
        {
            _securityAdapter = new WebSecurityAdapter();

            _testHelper = new WebPermissionProviderTestHelper();
            var serviceLocator = DefaultServiceLocator.Create();

            serviceLocator.RegisterMultiple <IWebSecurityAdapter>();
            serviceLocator.RegisterMultiple <IWxeSecurityAdapter> (() => _testHelper.WxeSecurityAdapter);
            _serviceLocatorScope = new ServiceLocatorScope(serviceLocator);
        }
Beispiel #8
0
        public void Setup()
        {
            _mocks = new MockRepository();
            _mockWebSecurityAdapter = _mocks.StrictMock <IWebSecurityAdapter> ();
            _mockNavigationCommand  = _mocks.StrictMock <NavigationCommand> ();

            var serviceLocator = DefaultServiceLocator.Create();

            serviceLocator.RegisterMultiple <IWebSecurityAdapter> (() => _mockWebSecurityAdapter);
            serviceLocator.RegisterMultiple <IWxeSecurityAdapter>();
            _serviceLocatorScope = new ServiceLocatorScope(serviceLocator);
        }
Beispiel #9
0
        public void Setup()
        {
            _mocks = new MockRepository();
            _mockWebSecurityAdapter = _mocks.StrictMock <IWebSecurityAdapter> ();
            _mockSecurableObject    = _mocks.StrictMock <ISecurableObject> ();

            var serviceLocator = DefaultServiceLocator.Create();

            serviceLocator.RegisterMultiple <IWebSecurityAdapter> (() => _mockWebSecurityAdapter);
            serviceLocator.RegisterMultiple <IWxeSecurityAdapter>();
            _serviceLocatorScope = new ServiceLocatorScope(serviceLocator);
        }
        public void SetUp()
        {
            _securityAdapter = new WebSecurityAdapter();

            _testHelper = new WebPermissionProviderTestHelper();

            var serviceLocator = DefaultServiceLocator.Create();

            serviceLocator.RegisterSingle(() => _testHelper.SecurityProvider);
            serviceLocator.RegisterSingle(() => _testHelper.PrincipalProvider);
            serviceLocator.RegisterSingle(() => _testHelper.FunctionalSecurityStrategy);
            _serviceLocatorScope = new ServiceLocatorScope(serviceLocator);
        }
Beispiel #11
0
        public void Init()
        {
            mockWebSecurityAdapter = MockRepository.GenerateMock <IWebSecurityAdapter>();

            mockCredentials = MockRepository.GenerateMock <ICredentials>();
            mockCredentials.Expect(m => m.UserName).Return("user name");
            mockCredentials.Expect(m => m.Password).Return("password");

            mockSubscriber = MockRepository.GenerateMock <ISubscriber>();
            mockSubscriber.Expect(m => m.UserName).Return("user name");
            mockSubscriber.Expect(m => m.Password).Return("password");
            mockSubscriber.Expect(m => m.IsRememberedAtNextLogOn).Return(true);
        }
Beispiel #12
0
        // construction and disposing

        public CommandTestHelper()
        {
            _httpContext = HttpContextHelper.CreateHttpContext("GET", "default.html", null);
            _httpContext.Response.ContentEncoding = Encoding.UTF8;

            _functionType     = typeof(TestFunction);
            _functionTypeName = TypeUtility.GetPartialAssemblyQualifiedName(_functionType);

            _mocks = new MockRepository();
            _mockWebSecurityAdapter = _mocks.StrictMock <IWebSecurityAdapter>();
            _mockWxeSecurityAdapter = _mocks.StrictMock <IWxeSecurityAdapter>();
            _mockSecurableObject    = _mocks.StrictMock <ISecurableObject>();

            _htmlWriter = new HtmlTextWriterSingleTagMock();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthenticationProvider"/> class.
 /// </summary>
 /// <param name="webSecurityAdapter">The web security adapter.</param>
 public AuthenticationProvider(IWebSecurityAdapter webSecurityAdapter)
 {
     Contract.Requires <ArgumentNullException>(webSecurityAdapter != null, "webSecurityAdapter must not be null");
     this.WebSecurityAdapter = webSecurityAdapter;
 }
Beispiel #14
0
 public void Setup()
 {
     _mocks = new MockRepository();
     _mockWebSecurityAdapter = _mocks.StrictMock <IWebSecurityAdapter>();
     _mockNavigationCommand  = _mocks.StrictMock <NavigationCommand> (CommandType.Href, _mockWebSecurityAdapter, (IWxeSecurityAdapter)null);
 }