public void TestInitialize() { IList<string> networkMachines = new List<string> { "FirstServer", "SecondServer", Environment.MachineName }; NetworkOperations = Substitute.For<INetworkOperations>(); NetworkOperations.GetMachines().Returns(Task.FromResult(networkMachines)); Conductor = new TestConductorScreen(); ConnectTo = new ConnectToMachineViewModel(NetworkOperations) { Parent = Conductor }; }
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); }