예제 #1
0
        public void WebServiceSourceDefinition_GetHashCode_Not_Equal_To_Zero()
        {
            const AuthenticationType expectedAuthenticationType = AuthenticationType.Public;
            const string             expectedDefaultQuery       = "testDefaultQuery";
            var          expectedId       = Guid.NewGuid();
            const string expectedName     = "testResourceName";
            const string expectedPassword = "******";
            const string expectedHostName = "testHost";
            const string expectedPath     = "testPath";
            const string expectedUserName = "******";

            var mockWebSource = new Mock <IWebSource>();

            mockWebSource.Setup(webSource => webSource.AuthenticationType).Returns(expectedAuthenticationType);
            mockWebSource.Setup(webSource => webSource.DefaultQuery).Returns(expectedDefaultQuery);
            mockWebSource.Setup(webSource => webSource.ResourceID).Returns(expectedId);
            mockWebSource.Setup(webSource => webSource.ResourceName).Returns(expectedName);
            mockWebSource.Setup(webSource => webSource.Password).Returns(expectedPassword);
            mockWebSource.Setup(webSource => webSource.Address).Returns(expectedHostName);
            mockWebSource.Setup(webSource => webSource.GetSavePath()).Returns(expectedPath);
            mockWebSource.Setup(webSource => webSource.UserName).Returns(expectedUserName);

            var webServiceSourceDefinition = new WebServiceSourceDefinition(mockWebSource.Object);

            var hashCode = webServiceSourceDefinition.GetHashCode();

            Assert.AreNotEqual(0, hashCode);
        }
예제 #2
0
        public void WebServiceSourceDefinition_GetHashCode_Expect_Zero()
        {
            var mockWebSource = new Mock <IWebSource>();

            var webServiceSourceDefinition = new WebServiceSourceDefinition(mockWebSource.Object);

            var hashCode = webServiceSourceDefinition.GetHashCode();

            Assert.AreEqual(0, hashCode);
        }