Exemple #1
0
        public void DifferentStringsReturnDifferentHash()
        {
            // Arrange
            SimpleCacheKeyHash subject = new SimpleCacheKeyHash();

            // Act
            string result1 = subject.GetHash("Somekey");
            string result2 = subject.GetHash("somekey");

            // Assert
            Assert.NotEqual(result1, result2);
        }
Exemple #2
0
        public void HashingStringTwiceAlwaysReturnsSameHash()
        {
            // Arrange
            SimpleCacheKeyHash subject = new SimpleCacheKeyHash();

            // Act
            string result1 = subject.GetHash("somekey");
            string result2 = subject.GetHash("somekey");

            // Assert
            Assert.Equal(result1, result2);
        }
Exemple #3
0
        public void ReturnsHashedString()
        {
            // Arrange
            SimpleCacheKeyHash subject = new SimpleCacheKeyHash();

            // Act
            string result = subject.GetHash("somekey");

            // Assert
            Assert.True(result.Length > 0);
        }