Inheritance: Dev2.Activities.Designers2.Foreach.ForeachDesignerViewModel
        public void ForeachDesignerViewModel_Constructor_ModelItemIsValid_ForeachTypesHasThreeItems()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestForeachDesignerViewModel(modelItem);

            Assert.AreEqual(4, viewModel.ForeachTypes.Count);
        }
 public void ForeachDesignerViewModel_Constructor_ModelItemIsValid_SelectedForeachTypeIsInitialized()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestForeachDesignerViewModel(modelItem);
     Assert.AreEqual(enForEachType.InRange, viewModel.ForEachType);
     Assert.AreEqual("* in Range", viewModel.SelectedForeachType);
     Assert.AreEqual(viewModel.FromVisibility, Visibility.Visible);
     Assert.AreEqual(viewModel.ToVisibility, Visibility.Visible);
     Assert.AreEqual(viewModel.CsvIndexesVisibility, Visibility.Hidden);
     Assert.AreEqual(viewModel.NumberVisibility, Visibility.Hidden);
     Assert.AreEqual(viewModel.RecordsetVisibility, Visibility.Hidden);
 }
Example #3
0
        public void ForeachDesignerViewModel_Constructor_ModelItemIsValid_SelectedForeachTypeIsInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestForeachDesignerViewModel(modelItem);

            Assert.AreEqual(enForEachType.InRange, viewModel.ForEachType);
            Assert.AreEqual("* in Range", viewModel.SelectedForeachType);
            Assert.AreEqual(viewModel.FromVisibility, Visibility.Visible);
            Assert.AreEqual(viewModel.ToVisibility, Visibility.Visible);
            Assert.AreEqual(viewModel.CsvIndexesVisibility, Visibility.Hidden);
            Assert.AreEqual(viewModel.NumberVisibility, Visibility.Hidden);
            Assert.AreEqual(viewModel.RecordsetVisibility, Visibility.Hidden);
        }
 public void ForeachDesignerViewModel_SetSelectedForeachTypeToinRecordset_ValidForeachType_ForeachTypeOnModelItemIsAlsoSet()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestForeachDesignerViewModel(modelItem);
     const string ExpectedValue = "* in Recordset";
     viewModel.SelectedForeachType = ExpectedValue;
     Assert.AreEqual(enForEachType.InRecordset, viewModel.ForEachType);
     Assert.AreEqual(viewModel.FromVisibility, Visibility.Hidden);
     Assert.AreEqual(viewModel.ToVisibility, Visibility.Hidden);
     Assert.AreEqual(viewModel.CsvIndexesVisibility, Visibility.Visible);
     Assert.AreEqual(viewModel.NumberVisibility, Visibility.Hidden);
     Assert.AreEqual(viewModel.RecordsetVisibility, Visibility.Visible);
 }
        public void ForeachDesignerViewModel_SetSelectedForeachTypeToinRecordset_ValidForeachType_ForeachTypeOnModelItemIsAlsoSet()
        {
            var          modelItem     = CreateModelItem();
            var          viewModel     = new TestForeachDesignerViewModel(modelItem);
            const string ExpectedValue = "* in Recordset";

            viewModel.SelectedForeachType = ExpectedValue;
            Assert.AreEqual(enForEachType.InRecordset, viewModel.ForEachType);
            Assert.AreEqual(viewModel.FromVisibility, Visibility.Hidden);
            Assert.AreEqual(viewModel.ToVisibility, Visibility.Hidden);
            Assert.AreEqual(viewModel.CsvIndexesVisibility, Visibility.Visible);
            Assert.AreEqual(viewModel.NumberVisibility, Visibility.Hidden);
            Assert.AreEqual(viewModel.RecordsetVisibility, Visibility.Visible);
        }
        public void ForeachDesignerViewModel_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 viewModel = new TestForeachDesignerViewModel(CreateModelItem());

            //------------Execute Test---------------------------
            viewModel.UpdateHelpDescriptor("help");
            //------------Assert Results-------------------------
            mockHelpViewModel.Verify(model => model.UpdateHelpText(It.IsAny <string>()), Times.Once());
        }
 public void ForeachDesignerViewModel_Constructor_ModelItemIsValid_ForeachTypesHasThreeItems()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestForeachDesignerViewModel(modelItem);
     Assert.AreEqual(4, viewModel.ForeachTypes.Count);
 }