public void ShouldReturnNameOfGivenEncodingType() { const string expectedToStringValue = "Base64"; Core.Enums.HashEncodingType type = Core.Enums.HashEncodingType.Base64; Assert.AreEqual(expectedToStringValue, type.ToString(), "Incorrect value for ToString returned."); }
public void ShouldReturnBase64WhenGivenBase64String(string encodingType) { Core.Enums.HashEncodingType expectedHashEncodingType = Core.Enums.HashEncodingType.Base64; Core.Enums.HashEncodingType hashEncodingType = Core.Enums.HashEncodingType.FromName(encodingType); Assert.AreEqual(expectedHashEncodingType, hashEncodingType, "Incorrect HashEncodingType returned."); }
public void ShouldThrowWhenGivenNullHashEncodingType() { Core.Enums.HashEncodingType nullHashEncodingType = null; TestDelegate methodThatShouldThrow = () => new Core.Impl.HashGetter(null, nullHashEncodingType); Assert.Throws <ArgumentNullException>(methodThatShouldThrow, "Excpetion should have been thrown for null HashEncodingType."); }
private IHashGetter GetHashGetter(Core.Enums.HashEncodingType hashEncodingType) { return(new Core.Impl.HashGetter(_mockedCryptoServiceProvider.Object, hashEncodingType)); }