Esempio n. 1
0
        public void SharePointServiceSourceDefinition_GetHashCode_Not_Equal_To_Zero()
        {
            const AuthenticationType expectedAuthenticationType = AuthenticationType.Public;
            const string             expectedServer             = "localhost";
            const string             expectedPath = "";
            var          expectedResourceID       = Guid.NewGuid();
            const string expectedResourceName     = "testResourceName";
            const string expectedPassword         = "******";
            const string expectedUserName         = "******";

            var mockSharepointSource = new Mock <ISharepointSource>();

            mockSharepointSource.Setup(sharepointSource => sharepointSource.AuthenticationType).Returns(expectedAuthenticationType);
            mockSharepointSource.Setup(sharepointSource => sharepointSource.Server).Returns(expectedServer);
            mockSharepointSource.Setup(sharepointSource => sharepointSource.GetSavePath()).Returns(expectedPath);
            mockSharepointSource.Setup(sharepointSource => sharepointSource.ResourceID).Returns(expectedResourceID);
            mockSharepointSource.Setup(sharepointSource => sharepointSource.ResourceName).Returns(expectedResourceName);
            mockSharepointSource.Setup(sharepointSource => sharepointSource.Password).Returns(expectedPassword);
            mockSharepointSource.Setup(sharepointSource => sharepointSource.UserName).Returns(expectedUserName);

            var sharePointServiceSourceDefinition = new SharePointServiceSourceDefinition(mockSharepointSource.Object);

            var hashCode = sharePointServiceSourceDefinition.GetHashCode();

            Assert.AreNotEqual(0, hashCode);
        }
Esempio n. 2
0
        public void SharePointServiceSourceDefinition_GetHashCode_Expect_Zero()
        {
            var mockSharepointSource = new Mock <ISharepointSource>();

            var sharePointServiceSourceDefinition = new SharePointServiceSourceDefinition(mockSharepointSource.Object);

            var hashCode = sharePointServiceSourceDefinition.GetHashCode();

            Assert.AreEqual(0, hashCode);
        }