Exemplo n.º 1
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)
			{
			}
		}
Exemplo n.º 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)
            {
            }
        }
Exemplo n.º 3
0
 static Base16Encoding()
 {
     Hex = new Base16Encoding(hexAlphabet, hexLookupTable);
 }
Exemplo n.º 4
0
		static Base16Encoding()
		{
			Hex = new Base16Encoding(hexAlphabet, hexLookupTable);
		}