Exemplo n.º 1
0
        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.");
        }
Exemplo n.º 2
0
        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.");
        }
Exemplo n.º 3
0
        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.");
        }
Exemplo n.º 4
0
 private IHashGetter GetHashGetter(Core.Enums.HashEncodingType hashEncodingType)
 {
     return(new Core.Impl.HashGetter(_mockedCryptoServiceProvider.Object, hashEncodingType));
 }