public void SuspendExecutionDesignerViewModel_Constructor_ModelItemIsValid_SuspendOptionsItems() { var modelItem = CreateModelItem(); var viewModel = new SuspendExecutionDesignerViewModel(modelItem); Assert.AreEqual(6, viewModel.SuspendOptions.Count); }
public void SuspendExecutionDesignerViewModel_SelectedSuspendOption_SuspendForSeconds() { var modelItem = CreateModelItem(); var viewModel = new SuspendExecutionDesignerViewModel(modelItem); const string expectedValue = "Suspend for Second(s):"; viewModel.SelectedSuspendOption = expectedValue; Assert.AreEqual(enSuspendOption.SuspendForSeconds, viewModel.SuspendOption); Assert.AreEqual("Second(s)", viewModel.SuspendOptionWatermark); }
public void SuspendExecutionDesignerViewModel_SelectedSuspendOption_SuspendUntil() { var modelItem = CreateModelItem(); var viewModel = new SuspendExecutionDesignerViewModel(modelItem); const string expectedValue = "Suspend until:"; viewModel.SelectedSuspendOption = expectedValue; Assert.AreEqual(enSuspendOption.SuspendUntil, viewModel.SuspendOption); Assert.AreEqual("Date Time", viewModel.SuspendOptionWatermark); }
public void SuspendExecutionDesignerViewModel_Constructor_ModelItemIsValid_Initialized() { var modelItem = CreateModelItem(); var viewModel = new SuspendExecutionDesignerViewModel(modelItem); viewModel.Validate(); Assert.AreEqual(enSuspendOption.SuspendUntil, viewModel.SuspendOption); Assert.AreEqual("Suspend until:", viewModel.SelectedSuspendOption); Assert.AreEqual(viewModel.SuspendOptionWatermark, "Date Time"); Assert.IsTrue(viewModel.HasLargeView); }
public void SuspendExecutionDesignerViewModel_UpdateHelp_ShouldCallToHelpViewModel() { //------------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 SuspendExecutionDesignerViewModel(CreateModelItem()); //------------Execute Test--------------------------- viewModel.UpdateHelpDescriptor("help"); //------------Assert Results------------------------- mockHelpViewModel.Verify(model => model.UpdateHelpText(It.IsAny <string>()), Times.Once()); }