public void SharePointCopyFileDesignerViewModel_SetProperties_ReturnsSuccess()
        {
            //------------Setup for test--------------------------

            var modelItem = CreateModelItem();

            modelItem.SetProperty("ServerInputPathFrom", "TestFolder");
            modelItem.SetProperty("ServerInputPathTo", "TestFolder");
            modelItem.SetProperty("SharepointServerResourceId", Guid.NewGuid());
            //------------Execute Test---------------------------
            var sharepointFileCopyDesignerViewModel = new SharePointCopyFileDesignerViewModel(modelItem, new SynchronousAsyncWorker(), new Mock <IServer>().Object);

            sharepointFileCopyDesignerViewModel.Errors = new List <IActionableErrorInfo> {
                new ActionableErrorInfo()
                {
                    Message = "Please Select a SharePoint Server"
                }
            };
            sharepointFileCopyDesignerViewModel.Validate();
            var inputPathfrom = modelItem.GetProperty <string>("ServerInputPathFrom");
            var inputPathTo   = modelItem.GetProperty <string>("ServerInputPathTo");
            var sourceId      = modelItem.GetProperty <Guid>("SharepointServerResourceId");

            Assert.IsNotNull(inputPathfrom);
            Assert.IsNotNull(inputPathTo);
            Assert.IsNotNull(sharepointFileCopyDesignerViewModel.ServerInputPathFrom);
            Assert.IsNotNull(sharepointFileCopyDesignerViewModel.ServerInputPathTo);
            Assert.AreNotEqual(sourceId, Guid.Empty);
            //------------Assert Results-------------------------
        }
        public void SharePointFileUploadDesignerViewModel_SetPropertiesNullLocalPathTo_ReturnsSuccess()
        {
            //------------Setup for test--------------------------

            var modelItem = CreateModelItem();

            modelItem.SetProperty("ServerInputPathFrom", "TestFolder");
            modelItem.SetProperty("SharepointServerResourceId", Guid.NewGuid());
            //------------Execute Test---------------------------
            var sharepointFileCopyDesignerViewModel = new SharePointCopyFileDesignerViewModel(modelItem, new SynchronousAsyncWorker(), new Mock <IServer>().Object);

            sharepointFileCopyDesignerViewModel.Errors = new List <IActionableErrorInfo> {
                new ActionableErrorInfo()
                {
                    Message = "Please Select a SharePoint Server"
                }
            };
            sharepointFileCopyDesignerViewModel.Validate();

            var inputPathfrom           = modelItem.GetProperty <string>("ServerInputPathFrom");
            var mockMainViewModel       = new Mock <IShellViewModel>();
            var mockHelpWindowViewModel = new Mock <IHelpWindowViewModel>();

            mockMainViewModel.Setup(model => model.HelpViewModel).Returns(mockHelpWindowViewModel.Object);
            CustomContainer.Register(mockMainViewModel.Object);

            sharepointFileCopyDesignerViewModel.UpdateHelpDescriptor("Test");
            Assert.IsNotNull(inputPathfrom);
            Assert.IsNotNull(sharepointFileCopyDesignerViewModel.ServerInputPathTo);
            //------------Assert Results-------------------------
        }
        public void SharePointCopyFileDesignerViewModel_Constructor_NullModelItem_ThrowsException()
        {
            //------------Setup for test--------------------------


            //------------Execute Test---------------------------
            var sharepointFileCopyDesignerViewModel = new SharePointCopyFileDesignerViewModel(CreateModelItem());

            //------------Assert Results-------------------------
            Assert.IsNull(sharepointFileCopyDesignerViewModel);
        }
        public void SharePointCopyFileDesignerViewModel_InitilizeProperties_ReturnsSuccess()
        {
            //------------Setup for test--------------------------


            //------------Execute Test---------------------------
            var sharepointFileCopyDesignerViewModel = new SharePointCopyFileDesignerViewModel(CreateModelItem(), new SynchronousAsyncWorker(), new Mock <IServer>().Object);

            sharepointFileCopyDesignerViewModel.UpdateHelpDescriptor("Test");

            Assert.IsNotNull(sharepointFileCopyDesignerViewModel);
            Assert.IsNotNull(sharepointFileCopyDesignerViewModel.CollectionName);
            //------------Assert Results-------------------------
        }