public void TestCtor()
		{
			try // null alphabet
			{
				var x = new Base16Encoding(null, Base16Encoding.Hex.LookupTable);

				Assert.Fail(typeof(ArgumentNullException).ToString());
			}
			catch (ArgumentNullException)
			{
			}

			try // bad length alphabet
			{
				var x = new Base16Encoding("1245645", Base16Encoding.Hex.LookupTable);

				Assert.Fail(typeof(ArgumentException).ToString());
			}
			catch (ArgumentException)
			{
			}

			try // look-up table null
			{
				var x = new Base16Encoding(Base16Encoding.Hex.Alphabet, null);

				Assert.Fail(typeof(ArgumentNullException).ToString());
			}
			catch (ArgumentNullException)
			{
			}

			try // look-up table bad length
			{
				var x = new Base16Encoding(Base16Encoding.Hex.Alphabet, new Byte[20]);

				Assert.Fail(typeof(ArgumentNullException).ToString());
			}
			catch (ArgumentException)
			{
			}
		}
Beispiel #2
0
        public void TestCtor()
        {
            try             // null alphabet
            {
                var x = new Base16Encoding(null, Base16Encoding.Hex.LookupTable);

                Assert.Fail(typeof(ArgumentNullException).ToString());
            }
            catch (ArgumentNullException)
            {
            }

            try             // bad length alphabet
            {
                var x = new Base16Encoding("1245645", Base16Encoding.Hex.LookupTable);

                Assert.Fail(typeof(ArgumentException).ToString());
            }
            catch (ArgumentException)
            {
            }

            try             // look-up table null
            {
                var x = new Base16Encoding(Base16Encoding.Hex.Alphabet, null);

                Assert.Fail(typeof(ArgumentNullException).ToString());
            }
            catch (ArgumentNullException)
            {
            }

            try             // look-up table bad length
            {
                var x = new Base16Encoding(Base16Encoding.Hex.Alphabet, new Byte[20]);

                Assert.Fail(typeof(ArgumentNullException).ToString());
            }
            catch (ArgumentException)
            {
            }
        }
Beispiel #3
0
 static Base16Encoding()
 {
     Hex = new Base16Encoding(hexAlphabet, hexLookupTable);
 }
		static Base16Encoding()
		{
			Hex = new Base16Encoding(hexAlphabet, hexLookupTable);
		}