예제 #1
0
        public void ValidateHashShouldReturnTrueWhenHashMatches()
        {
            var hash = new FileCacheHash();

            Assert.IsTrue(hash.ValidateHash("// @hash " + SAMPLE_HASH + "\nHello World", SAMPLE_HASH));
        }
예제 #2
0
        public void ValidateHashShouldReturnFalseWhenNoHashPrefix()
        {
            var hash = new FileCacheHash();

            Assert.IsFalse(hash.ValidateHash("Hello World", SAMPLE_HASH));
        }
예제 #3
0
        public void ValidateHashShouldReturnFalseWhenHashDoesNotMatch()
        {
            var hash = new FileCacheHash();

            Assert.IsFalse(hash.ValidateHash("// @hash NOTCORRECT\nHello World", SAMPLE_HASH));
        }
예제 #4
0
        public void ValidateHashShouldReturnFalseForEmptyString()
        {
            var hash = new FileCacheHash();

            Assert.IsFalse(hash.ValidateHash(string.Empty, SAMPLE_HASH));
        }
예제 #5
0
        public void ValidateHashShouldReturnFalseForNull()
        {
            var hash = new FileCacheHash();

            Assert.IsFalse(hash.ValidateHash(null, SAMPLE_HASH));
        }
예제 #6
0
		public void ValidateHashShouldReturnTrueWhenHashMatches()
		{
			var hash = new FileCacheHash();
			Assert.IsTrue(hash.ValidateHash("// @hash v3-" + SAMPLE_HASH + "\nHello World", SAMPLE_HASH));
		}
예제 #7
0
		public void ValidateHashShouldReturnFalseWhenHashDoesNotMatch()
		{
			var hash = new FileCacheHash();
			Assert.IsFalse(hash.ValidateHash("// @hash NOTCORRECT\nHello World", SAMPLE_HASH));
		}
예제 #8
0
		public void ValidateHashShouldReturnFalseWhenNoHashPrefix()
		{
			var hash = new FileCacheHash();
			Assert.IsFalse(hash.ValidateHash("Hello World", SAMPLE_HASH));
		}
예제 #9
0
		public void ValidateHashShouldReturnFalseForNull()
		{
			var hash = new FileCacheHash();
			Assert.IsFalse(hash.ValidateHash(null, SAMPLE_HASH));
		}
예제 #10
0
		public void ValidateHashShouldReturnFalseForEmptyString()
		{
			var hash = new FileCacheHash();
			Assert.IsFalse(hash.ValidateHash(string.Empty, SAMPLE_HASH));
		}