Пример #1
0
        public void Decode_ValueIsNull_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws <ArgumentNullException>(() => Bijective.Decode(null, Alphabet.Base62));

            Assert.Contains("value must not be null", exception.Message);
        }
Пример #2
0
 public void Decode(int expected, string value, string alphabet)
 {
     Assert.Equal(expected, Bijective.Decode(value, alphabet));
 }
Пример #3
0
        public void Decode_AlphabetIsNull_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws <ArgumentNullException>(() => Bijective.Decode("1", null));

            Assert.Contains("alphabet must not be null", exception.Message);
        }
Пример #4
0
        public void Decode_AlphabetIsAnEmptyString_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws <ArgumentException>(() => Bijective.Decode("1", ""));

            Assert.Contains("alphabet must not be an empty string", exception.Message);
        }
Пример #5
0
        public void Decode_ValueIsAnEmptyString_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws <ArgumentException>(() => Bijective.Decode("", Alphabet.Base62));

            Assert.Contains("value must not be an empty string", exception.Message);
        }