Exemplo n.º 1
0
        public void RedisSourceDefinition_GetHashCode_Expect_Zero()
        {
            var mockRedisSource = new Mock <IRedisSource>();

            var redisSourceDefinition = new RedisSourceDefinition(mockRedisSource.Object);

            var hashCode = redisSourceDefinition.GetHashCode();

            Assert.AreEqual(0, hashCode);
        }
Exemplo n.º 2
0
        public void RedisSourceDefinition_GetHashCode_Not_Equal_To_Zero()
        {
            const AuthenticationType expectedAuthenticationType = AuthenticationType.Password;
            var          expectedId       = Guid.NewGuid();
            const string expectedName     = "testResourceName";
            const string expectedPassword = "******";
            const string expectedHostName = "testHost";
            const string expectedPath     = "testPath";

            var mockRedisSource = new Mock <IRedisSource>();

            mockRedisSource.Setup(redisSource => redisSource.AuthenticationType).Returns(expectedAuthenticationType);
            mockRedisSource.Setup(redisSource => redisSource.ResourceID).Returns(expectedId);
            mockRedisSource.Setup(redisSource => redisSource.ResourceName).Returns(expectedName);
            mockRedisSource.Setup(redisSource => redisSource.Password).Returns(expectedPassword);
            mockRedisSource.Setup(redisSource => redisSource.HostName).Returns(expectedHostName);
            mockRedisSource.Setup(redisSource => redisSource.GetSavePath()).Returns(expectedPath);

            var redisSourceDefinition = new RedisSourceDefinition(mockRedisSource.Object);

            var hashCode = redisSourceDefinition.GetHashCode();

            Assert.AreNotEqual(0, hashCode);
        }