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