public void SharePointSource_Validate_LoadLists()
        {
            var expectedSharepointList = new System.Collections.Generic.List <ISharepointListTo>
            {
                new SharepointListTo {
                    FullName = "SharepointFullName"
                },
                new SharepointListTo {
                    FullName = "SharepointFullNameDup"
                }
            };

            const string server             = "localhost";
            const string userName           = "******";
            const string password           = "******";
            const bool   isSharepointOnline = false;

            var mockSharepointHelperFactory = new Mock <ISharepointHelperFactory>();

            mockSharepointHelperFactory.Setup(sharepointHelperFactory => sharepointHelperFactory.New(server, userName, password, isSharepointOnline).LoadLists()).Returns(expectedSharepointList);

            var sharepointSource = new SharepointSource(mockSharepointHelperFactory.Object);

            var sharepointList = sharepointSource.LoadLists();

            Assert.AreEqual(2, sharepointList.Count);
            Assert.AreEqual("SharepointFullName", sharepointList[0].FullName);
            Assert.AreEqual("SharepointFullNameDup", sharepointList[1].FullName);
        }
        public void SharePointSource_Validate_LoadLists()
        {
            var expectedSharepointList = new System.Collections.Generic.List <ISharepointListTo>
            {
                new SharepointListTo {
                    FullName = "SharepointFullName"
                },
                new SharepointListTo {
                    FullName = "SharepointFullNameDup"
                }
            };

            const bool isSharepointOnline = false;

            var expectedSharepointHelper = new Mock <ISharepointHelper>();

            expectedSharepointHelper.Setup(sharepointHelper => sharepointHelper.LoadLists()).Returns(expectedSharepointList);
            var mockSharepointHelperFactory = new Mock <ISharepointHelperFactory>();

            mockSharepointHelperFactory.Setup(sharepointHelperFactory => sharepointHelperFactory.New(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), isSharepointOnline)).Returns(expectedSharepointHelper.Object);

            var sharepointSource = new SharepointSource(mockSharepointHelperFactory.Object);

            var sharepointList = sharepointSource.LoadLists();

            Assert.AreEqual(2, sharepointList.Count);
            Assert.AreEqual("SharepointFullName", sharepointList[0].FullName);
            Assert.AreEqual("SharepointFullNameDup", sharepointList[1].FullName);
        }