Inheritance: Dev2.Activities.Designers2.DateTimeDifference.DateTimeDifferenceDesignerViewModel
 public void DateTimeDifferenceDesignerViewModel_Constructor_ModelItemIsValid_SelectedOutputTypeAreInitialized()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestDateTimeDifferenceDesignerViewModel(modelItem);
     var expected = new List<string>(DateTimeComparer.OutputFormatTypes);
     CollectionAssert.AreEqual(expected, viewModel.OutputTypes);
 }
 public void DateTimeDifferenceDesignerViewModel_Constructor_ModelItemIsValid_SelectedOutputTypeIsInitialized()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestDateTimeDifferenceDesignerViewModel(modelItem);
     Assert.AreEqual("Years", viewModel.OutputType);
     Assert.AreEqual("Years", viewModel.SelectedOutputType);
 }
 public void DateTimeDifferenceDesignerViewModel_SetSelectedOutputType_ValidType_OutputTypeOnModelItemIsAlsoSet()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestDateTimeDifferenceDesignerViewModel(modelItem);
     const string ExpectedValue = "Normal";
     viewModel.SelectedOutputType = ExpectedValue;
     Assert.AreEqual(ExpectedValue, viewModel.OutputType);
 }
        public void DateTimeDifferenceDesignerViewModel_Constructor_ModelItemIsValid_SelectedOutputTypeAreInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestDateTimeDifferenceDesignerViewModel(modelItem);
            var expected  = new List <string>(DateTimeComparer.OutputFormatTypes);

            CollectionAssert.AreEqual(expected, viewModel.OutputTypes);
        }
        public void DateTimeDifferenceDesignerViewModel_Constructor_ModelItemIsValid_SelectedOutputTypeIsInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestDateTimeDifferenceDesignerViewModel(modelItem);

            Assert.AreEqual("Years", viewModel.OutputType);
            Assert.AreEqual("Years", viewModel.SelectedOutputType);
        }
        public void DateTimeDifferenceDesignerViewModel_SetSelectedOutputType_ValidType_OutputTypeOnModelItemIsAlsoSet()
        {
            var          modelItem     = CreateModelItem();
            var          viewModel     = new TestDateTimeDifferenceDesignerViewModel(modelItem);
            const string ExpectedValue = "Normal";

            viewModel.SelectedOutputType = ExpectedValue;
            Assert.AreEqual(ExpectedValue, viewModel.OutputType);
        }
Ejemplo n.º 7
0
        public void DateTimeDifferenceDesignerViewModel_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 TestDateTimeDifferenceDesignerViewModel(CreateModelItem());

            //------------Execute Test---------------------------
            viewModel.UpdateHelpDescriptor("help");
            //------------Assert Results-------------------------
            mockHelpViewModel.Verify(model => model.UpdateHelpText(It.IsAny <string>()), Times.Once());
        }