Ejemplo n.º 1
0
        public void TestInitialize()
        {
            ScreenFactory     = Substitute.For <IScreenFactory>();
            WindowManager     = Substitute.For <IWindowManagerEx>();
            QueueExplorer     = Substitute.For <IQueueExplorerViewModel>();
            EndpointExplorer  = Substitute.For <IEndpointExplorerViewModel>();
            MessageList       = Substitute.For <IMessageListViewModel>();
            NetworkOperations = Substitute.For <INetworkOperations>();
            ExceptionHandler  = Substitute.For <IExceptionHandler>();
            StatusbarManager  = Substitute.For <StatusBarManager>();
            EventAggregator   = Substitute.For <IEventAggregator>();
            MessageFlow       = Substitute.For <IMessageFlowViewModel>();
            MessageBodyView   = Substitute.For <IMessageBodyViewModel>();
            MessageProperties = Substitute.For <IMessagePropertiesViewModel>();
            View               = Substitute.For <IShellViewStub>();
            SettingsProvider   = Substitute.For <ISettingsProvider>();
            LicenseManager     = Substitute.For <ILicenseManager>();
            LogWindow          = Substitute.For <ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For <ConnectToMachineViewModel>(NetworkOperations);
            SettingsProvider.GetSettings <ProfilerSettings>().Returns(DefaultAppSetting());
            App   = Substitute.For <IAppCommands>();
            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer, EndpointExplorer, MessageList,
                                       StatusbarManager, EventAggregator, LicenseManager, MessageFlow, MessageBodyView,
                                       SettingsProvider, MessageProperties, LogWindow);

            ScreenFactory.CreateScreen <ConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
        public void TestInitialize()
        {
            ScreenFactory     = Substitute.For <IScreenFactory>();
            WindowManager     = Substitute.For <IWindowManagerEx>();
            QueueExplorer     = Substitute.For <IQueueExplorerViewModel>();
            EndpointExplorer  = Substitute.For <IEndpointExplorerViewModel>();
            MessageList       = Substitute.For <IMessageListViewModel>();
            StatusbarManager  = Substitute.For <IStatusBarManager>();
            EventAggregator   = Substitute.For <IEventAggregator>();
            MessageFlow       = Substitute.For <IMessageFlowViewModel>();
            SagaWindow        = Substitute.For <ISagaWindowViewModel>();
            MessageBodyView   = Substitute.For <IMessageBodyViewModel>();
            MessageProperties = Substitute.For <IMessagePropertiesViewModel>();
            View               = Substitute.For <IShellViewStub>();
            HeaderView         = Substitute.For <IMessageHeadersViewModel>();
            SettingsProvider   = Substitute.For <ISettingsProvider>();
            LicenseManager     = Substitute.For <AppLicenseManager>();
            LogWindow          = Substitute.For <ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For <IConnectToMachineViewModel>();
            SettingsProvider.GetSettings <ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For <IAppCommands>();
            CommandLineArgParser = MockEmptyStartupOptions();

            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer,
                                       EndpointExplorer, MessageList, StatusbarManager,
                                       EventAggregator, LicenseManager, MessageFlow, SagaWindow,
                                       MessageBodyView, HeaderView, SettingsProvider, MessageProperties,
                                       LogWindow, CommandLineArgParser);

            ScreenFactory.CreateScreen <IConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
 public void TestInitialize()
 {
     IList<string> machines = new List<string> { Environment.MachineName, "AnotherMachine" };
     QueueManager = Substitute.For<IQueueManagerAsync>();
     Explorer = Substitute.For<IQueueExplorerViewModel>();
     Network = Substitute.For<INetworkOperations>();
     Model = new Desktop.Shell.QueueCreationViewModel(QueueManager, Explorer, Network);
     Network.GetMachines().Returns(Task.FromResult(machines));
 }
        public void TestInitialize()
        {
            IList <string> machines = new List <string> {
                Environment.MachineName, "AnotherMachine"
            };

            QueueManager = Substitute.For <IQueueManagerAsync>();
            Explorer     = Substitute.For <IQueueExplorerViewModel>();
            Network      = Substitute.For <INetworkOperations>();
            Model        = new Desktop.Shell.QueueCreationViewModel(QueueManager, Explorer, Network);
            Network.GetMachines().Returns(Task.FromResult(machines));
        }
 public QueueCreationViewModel(
     IQueueManagerAsync queueManager, 
     IQueueExplorerViewModel explorer,
     INetworkOperations networkOperations)
 {
     _queueManager = queueManager;
     _explorer = explorer;
     _networkOperations = networkOperations;
     Machines = new List<string>();
     DisplayName = "Queue";
     IsTransactional = true;
 }
 public QueueCreationViewModel(
     IQueueManager queueManager,
     IQueueExplorerViewModel explorer,
     INetworkOperations networkOperations)
 {
     _queueManager      = queueManager;
     _explorer          = explorer;
     _networkOperations = networkOperations;
     Machines           = new List <string>();
     DisplayName        = "Queue";
     IsTransactional    = true;
 }
Ejemplo n.º 7
0
        public ShellViewModel(
            IAppCommands appCommander,
            IScreenFactory screenFactory,
            IWindowManagerEx windowManager,
            IQueueExplorerViewModel queueExplorer,
            IEndpointExplorerViewModel endpointExplorer,
            IMessageListViewModel messages,
            IStatusBarManager statusBarManager,
            IEventAggregator eventAggregator,
            AppLicenseManager licenseManager,
            IMessageFlowViewModel messageFlow,
            ISagaWindowViewModel sagaWindow,
            IMessageBodyViewModel messageBodyViewer,
            IMessageHeadersViewModel messageHeadersViewer,
            ISettingsProvider settingsProvider,
            IMessagePropertiesViewModel messageProperties,
            ILogWindowViewModel logWindow,
            ICommandLineArgParser comandLineArgParser)
        {
            _appCommander        = appCommander;
            _screenFactory       = screenFactory;
            _windowManager       = windowManager;
            _eventAggregator     = eventAggregator;
            _licenseManager      = licenseManager;
            _settingsProvider    = settingsProvider;
            _comandLineArgParser = comandLineArgParser;
            MessageProperties    = messageProperties;
            MessageFlow          = messageFlow;
            SagaWindow           = sagaWindow;
            StatusBarManager     = statusBarManager;
            QueueExplorer        = queueExplorer;
            EndpointExplorer     = endpointExplorer;
            MessageHeaders       = messageHeadersViewer;
            MessageBody          = messageBodyViewer;
            Messages             = messages;
            LogWindow            = logWindow;

            Items.Add(queueExplorer);
            Items.Add(endpointExplorer);
            Items.Add(messages);
            Items.Add(messageHeadersViewer);
            Items.Add(messageBodyViewer);
            Items.Add(messageFlow);

            InitializeAutoRefreshTimer();
            InitializeIdleTimer();
        }
Ejemplo n.º 8
0
        public void TestInitialize()
        {
            ScreenFactory = Substitute.For<IScreenFactory>();
            WindowManager = Substitute.For<IWindowManagerEx>();
            QueueExplorer = Substitute.For<IQueueExplorerViewModel>();
            EndpointExplorer = Substitute.For<IEndpointExplorerViewModel>();
            MessageList = Substitute.For<IMessageListViewModel>();
            NetworkOperations = Substitute.For<INetworkOperations>();
            ExceptionHandler = Substitute.For<IExceptionHandler>();
            StatusbarManager = Substitute.For<StatusBarManager>();
            EventAggregator = Substitute.For<IEventAggregator>();
            MessageFlow = Substitute.For<IMessageFlowViewModel>();
            MessageBodyView = Substitute.For<IMessageBodyViewModel>();
            MessageProperties = Substitute.For<IMessagePropertiesViewModel>();
            View = Substitute.For<IShellViewStub>();
            SettingsProvider = Substitute.For<ISettingsProvider>();
            LicenseManager = Substitute.For<ILicenseManager>();
            LogWindow = Substitute.For<ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For<ConnectToMachineViewModel>(NetworkOperations);
            SettingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For<IAppCommands>();
            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer, EndpointExplorer, MessageList,
                                       StatusbarManager, EventAggregator, LicenseManager, MessageFlow, MessageBodyView,
                                       SettingsProvider, MessageProperties, LogWindow);

            ScreenFactory.CreateScreen<ConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
        public void TestInitialize()
        {
            ScreenFactory = Substitute.For<IScreenFactory>();
            WindowManager = Substitute.For<IWindowManagerEx>();
            QueueExplorer = Substitute.For<IQueueExplorerViewModel>();
            EndpointExplorer = Substitute.For<IEndpointExplorerViewModel>();
            MessageList = Substitute.For<IMessageListViewModel>();
            StatusbarManager = Substitute.For<IStatusBarManager>();
            EventAggregator = Substitute.For<IEventAggregator>();
            MessageFlow = Substitute.For<IMessageFlowViewModel>();
            SagaWindow = Substitute.For<ISagaWindowViewModel>();
            MessageBodyView = Substitute.For<IMessageBodyViewModel>();
            MessageProperties = Substitute.For<IMessagePropertiesViewModel>();
            View = Substitute.For<IShellViewStub>();
            HeaderView = Substitute.For<IMessageHeadersViewModel>();
            SettingsProvider = Substitute.For<ISettingsProvider>();
            LicenseManager = Substitute.For<AppLicenseManager>();
            LogWindow = Substitute.For<ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For<IConnectToMachineViewModel>();
            SettingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For<IAppCommands>();
            CommandLineArgParser = MockEmptyStartupOptions();

            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer,
                                       EndpointExplorer, MessageList, StatusbarManager,
                                       EventAggregator, LicenseManager, MessageFlow, SagaWindow,
                                       MessageBodyView, HeaderView, SettingsProvider, MessageProperties,
                                       LogWindow, CommandLineArgParser);

            ScreenFactory.CreateScreen<IConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }