public void OpenUriHelpCommandTest() { Assert.IsNull(this.viewModel.ConnectUri); MockUriHelpView view = Container.GetExportedValue <IUriHelpView>() as MockUriHelpView; view.ShowDialogAction = (x) => { UriHelpViewModel uriHelpViewModel = x.GetViewModel <UriHelpViewModel>(); uriHelpViewModel.CancelCommand.Execute(null); }; this.viewModel.UriHelpCommand.Execute(null); Assert.IsNull(this.viewModel.ConnectUri); view.ShowDialogAction = (x) => { UriHelpViewModel uriHelpViewModel = x.GetViewModel <UriHelpViewModel>(); uriHelpViewModel.ServerName = TheCodePlexUri; uriHelpViewModel.SubmitCommand.Execute(null); }; this.viewModel.UriHelpCommand.Execute(null); Assert.IsNotNull(this.viewModel.ConnectUri); Assert.AreEqual( new Uri(TheCodePlexUri).AbsoluteUri, this.viewModel.ConnectUri.AbsoluteUri); }
protected override void OnTestInitialize() { IUriHelpView view = Container.GetExportedValue <IUriHelpView>(); this.viewModel = new UriHelpViewModel(view); }
protected override void OnTestInitialize() { IUriHelpView view = Container.GetExportedValue<IUriHelpView>(); this.viewModel = new UriHelpViewModel(view); }