public void XPathDesignerViewModel_Constructor_ModelItemIsValid_ResultsCollectionHasTwoItems() { var modelItem = ModelItemUtils.CreateModelItem(new DsfXPathActivity()); var viewModel = new XPathDesignerViewModel(modelItem); dynamic mi = viewModel.ModelItem; Assert.AreEqual(2, mi.ResultsCollection.Count); }
public void XPathDesignerViewModel_Constructor_ModelItemIsValid_CollectionNameIsSetToResultsCollection() { var items = new List <XPathDTO> { new XPathDTO() }; var viewModel = new XPathDesignerViewModel(CreateModelItem(items)); Assert.AreEqual("ResultsCollection", viewModel.CollectionName); }
public void XPathDesignerViewModel_Constructor_ModelItemIsInitializedWith4Items_ResultsCollectionHasFourItems() { var items = new List<XPathDTO> { new XPathDTO("", "None", 0), new XPathDTO("", "None", 0), new XPathDTO("", "None", 0), new XPathDTO("", "None", 0) }; var viewModel = new XPathDesignerViewModel(CreateModelItem(items)); dynamic mi = viewModel.ModelItem; Assert.AreEqual(5, mi.ResultsCollection.Count); }
public void XPathDesignerViewModel_Constructor_ModelItemIsInitializedWith4Items_ResultsCollectionHasFourItems() { var items = new List <XPathDTO> { new XPathDTO("", "None", 0), new XPathDTO("", "None", 0), new XPathDTO("", "None", 0), new XPathDTO("", "None", 0) }; var viewModel = new XPathDesignerViewModel(CreateModelItem(items)); dynamic mi = viewModel.ModelItem; Assert.AreEqual(5, mi.ResultsCollection.Count); }
public void XPathDesignerViewModel_UpdateHelp_ShouldCallToHelpViewMode() { //------------Setup for test-------------------------- var mockMainViewModel = new Mock <IShellViewModel>(); var mockHelpViewModel = new Mock <IHelpWindowViewModel>(); mockHelpViewModel.Setup(model => model.UpdateHelpText(It.IsAny <string>())).Verifiable(); mockMainViewModel.Setup(model => model.HelpViewModel).Returns(mockHelpViewModel.Object); CustomContainer.Register(mockMainViewModel.Object); var items = new List <XPathDTO> { new XPathDTO() }; var viewModel = new XPathDesignerViewModel(CreateModelItem(items)); //------------Execute Test--------------------------- viewModel.UpdateHelpDescriptor("help"); //------------Assert Results------------------------- mockHelpViewModel.Verify(model => model.UpdateHelpText(It.IsAny <string>()), Times.Once()); }
public void XPathDesignerViewModel_Constructor_ModelItemIsValid_CollectionNameIsSetToResultsCollection() { var items = new List<XPathDTO> { new XPathDTO() }; var viewModel = new XPathDesignerViewModel(CreateModelItem(items)); Assert.AreEqual("ResultsCollection", viewModel.CollectionName); }