Esempio n. 1
0
        public void Show_ShouldCall_Modal_BeforeOpenModal()
        {
            var     modals  = new ProtonVPN.Modals.Modals(_scheduler, _container, _windowManager, _modalWindows);
            dynamic options = new ExpandoObject();

            modals.Show <WrappedModal>(options);

            _modal.Received(1).BeforeOpenModal(options);
        }
Esempio n. 2
0
        public void Show_ShouldCall_WindowManager_ShowDialog()
        {
            var wrappedModal = _container.Resolve <WrappedModal>();
            var modals       = new ProtonVPN.Modals.Modals(_scheduler, _container, _windowManager, _modalWindows);

            modals.Show <WrappedModal>();

            _windowManager.Received(1).ShowDialog(
                wrappedModal,
                Arg.Is <object>(o => o == null),
                Arg.Any <IDictionary <string, object> >());
        }
Esempio n. 3
0
        public void Show_ShouldCall_WindowManager_ShowDialog_WithDefaultSettings()
        {
            var modals = new ProtonVPN.Modals.Modals(_scheduler, _container, _windowManager, _modalWindows);

            modals.Show <WrappedModal>();

            _windowManager.Received(1).ShowDialog(
                Arg.Any <object>(),
                Arg.Any <object>(),
                Arg.Is <IDictionary <string, object> >(d =>
                                                       (WindowStartupLocation)d["WindowStartupLocation"] == WindowStartupLocation.CenterOwner &&
                                                       (ResizeMode)d["ResizeMode"] == ResizeMode.NoResize));
        }
Esempio n. 4
0
        public void Show_ShouldReturnFalse_IfAlreadyOpened()
        {
            // Arrange
            var modalViewModel = new WrappedModal(_modal);

            _modalWindows.List().Returns(new[]
            {
                new BaseModalWindow {
                    DataContext = modalViewModel
                }
            });
            var modals = new ProtonVPN.Modals.Modals(_scheduler, _container, _windowManager, _modalWindows);

            // Assert
            modals.Show <WrappedModal>().Should().BeFalse("Modal already opened");
        }