public void SharePointFileDownLoadDesignerViewModel_SetProperties_ReturnsSuccess() { //------------Setup for test-------------------------- var modelItem = CreateModelItem(); modelItem.SetProperty("LocalInputPath", "TestFolder"); modelItem.SetProperty("SharepointServerResourceId", Guid.NewGuid()); //------------Execute Test--------------------------- var sharepointReadFolderDesignerViewModel = new SharePointFileDownLoadDesignerViewModel(modelItem, new SynchronousAsyncWorker(), new Mock <IServer>().Object); sharepointReadFolderDesignerViewModel.Errors = new List <IActionableErrorInfo> { new ActionableErrorInfo() { Message = "Please Select a SharePoint Server" } }; sharepointReadFolderDesignerViewModel.Validate(); var inputPath = modelItem.GetProperty <string>("LocalInputPath"); var sourceId = modelItem.GetProperty <Guid>("SharepointServerResourceId"); var mockMainViewModel = new Mock <IShellViewModel>(); var mockHelpWindowViewModel = new Mock <IHelpWindowViewModel>(); mockMainViewModel.Setup(model => model.HelpViewModel).Returns(mockHelpWindowViewModel.Object); CustomContainer.Register(mockMainViewModel.Object); sharepointReadFolderDesignerViewModel.UpdateHelpDescriptor("Test"); Assert.IsNotNull(inputPath); Assert.IsNotNull(sharepointReadFolderDesignerViewModel.LocalInputPath); Assert.AreNotEqual(sourceId, Guid.Empty); //------------Assert Results------------------------- }
public void SharePointFileDownLoadDesignerViewModel_InitilizeProperties_ReturnsSuccess() { //------------Setup for test-------------------------- //------------Execute Test--------------------------- var sharepointFileDownLoadDesignerViewModel = new SharePointFileDownLoadDesignerViewModel(CreateModelItem(), new SynchronousAsyncWorker(), new Mock <IServer>().Object); sharepointFileDownLoadDesignerViewModel.UpdateHelpDescriptor("Test"); Assert.IsNotNull(sharepointFileDownLoadDesignerViewModel); Assert.IsNotNull(sharepointFileDownLoadDesignerViewModel.CollectionName); //------------Assert Results------------------------- }