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);
 }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
 }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
 }