Inheritance: Dev2.Activities.Designers2.FindIndex.FindIndexDesignerViewModel
 public void FindIndexDesignerViewModel_Constructor_ModelItemIsValid_SelectedIndexIsInitialized()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestFindIndexDesignerViewModel(modelItem);
     Assert.AreEqual("First Occurrence", viewModel.Index);
     Assert.AreEqual("First Occurrence", viewModel.SelectedIndex);
 }
 public void FindDirectionDesignerViewModel_Constructor_ModelItemIsValid_SelectedDirectionIsInitialized()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestFindIndexDesignerViewModel(modelItem);
     Assert.AreEqual("Left to Right", viewModel.Direction);
     Assert.AreEqual("Left to Right", viewModel.SelectedDirection);
 }
        public void FindDirectionDesignerViewModel_Constructor_ModelItemIsValid_DirectionListHasTowItems()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestFindIndexDesignerViewModel(modelItem);

            Assert.AreEqual(2, viewModel.DirectionList.Count);
        }
 public void FindIndexDesignerViewModel_SetSelectedIndex_ValidIndex_IndexOnModelItemIsAlsoSet()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestFindIndexDesignerViewModel(modelItem);
     const string ExpectedValue = "Last Occurrence";
     viewModel.SelectedIndex = ExpectedValue;
     Assert.AreEqual(ExpectedValue, viewModel.Index);
 }
Exemple #5
0
        public void FindDirectionDesignerViewModel_Constructor_ModelItemIsValid_SelectedDirectionIsInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestFindIndexDesignerViewModel(modelItem);

            Assert.AreEqual("Left to Right", viewModel.Direction);
            Assert.AreEqual("Left to Right", viewModel.SelectedDirection);
        }
        public void FindIndexDesignerViewModel_Constructor_ModelItemIsValid_SelectedIndexIsInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestFindIndexDesignerViewModel(modelItem);

            Assert.AreEqual("First Occurrence", viewModel.Index);
            Assert.AreEqual("First Occurrence", viewModel.SelectedIndex);
        }
Exemple #7
0
        public void FindIndexDesignerViewModel_SetSelectedIndex_ValidIndex_IndexOnModelItemIsAlsoSet()
        {
            var          modelItem     = CreateModelItem();
            var          viewModel     = new TestFindIndexDesignerViewModel(modelItem);
            const string ExpectedValue = "Last Occurrence";

            viewModel.SelectedIndex = ExpectedValue;
            Assert.AreEqual(ExpectedValue, viewModel.Index);
        }
Exemple #8
0
        public void FindDirectionDesignerViewModel_SetSelectedDirection_ValidDirection_DirectionOnModelItemIsAlsoSet()
        {
            var          modelItem     = CreateModelItem();
            var          viewModel     = new TestFindIndexDesignerViewModel(modelItem);
            const string ExpectedValue = "Right to Left";

            viewModel.SelectedDirection = ExpectedValue;
            Assert.AreEqual(ExpectedValue, viewModel.Direction);
        }
        public void FindIndexDesignerViewModel_Constructor_ModelItemIsValid_IndexListHasThreeItems()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestFindIndexDesignerViewModel(modelItem);

            var expectedIndices = new List<string> { "First Occurrence", "Last Occurrence", "All Occurrences" };
            var expectedDirections = new List<string> { "Left to Right", "Right to Left" };

            CollectionAssert.AreEqual(expectedIndices, viewModel.IndexList.ToList());
            CollectionAssert.AreEqual(expectedDirections, viewModel.DirectionList.ToList());
        }
Exemple #10
0
        public void FindIndexDesignerViewModel_Constructor_ModelItemIsValid_IndexListHasThreeItems()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestFindIndexDesignerViewModel(modelItem);

            var expectedIndices = new List <string> {
                "First Occurrence", "Last Occurrence", "All Occurrences"
            };
            var expectedDirections = new List <string> {
                "Left to Right", "Right to Left"
            };

            CollectionAssert.AreEqual(expectedIndices, viewModel.IndexList.ToList());
            CollectionAssert.AreEqual(expectedDirections, viewModel.DirectionList.ToList());
        }
Exemple #11
0
        public void FindDirectionDesignerViewModel_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 modelItem = CreateModelItem();
            var viewModel = new TestFindIndexDesignerViewModel(modelItem);

            //------------Execute Test---------------------------
            viewModel.UpdateHelpDescriptor("help");
            //------------Assert Results-------------------------
            mockHelpViewModel.Verify(model => model.UpdateHelpText(It.IsAny <string>()), Times.Once());
        }
 public void FindDirectionDesignerViewModel_SetSelectedDirection_ValidDirection_DirectionOnModelItemIsAlsoSet()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestFindIndexDesignerViewModel(modelItem);
     const string ExpectedValue = "Right to Left";
     viewModel.SelectedDirection = ExpectedValue;
     Assert.AreEqual(ExpectedValue, viewModel.Direction);
 }
 public void FindDirectionDesignerViewModel_Constructor_ModelItemIsValid_DirectionListHasTowItems()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestFindIndexDesignerViewModel(modelItem);
     Assert.AreEqual(2, viewModel.DirectionList.Count);
 }