Exemplo n.º 1
0
        public void H2XTest()
        {
//            Assert.Throws<ArgumentOutOfRangeException>(() => AnyRadixConvert.H2X(123UL, 0));
//            Assert.Throws<ArgumentOutOfRangeException>(() => AnyRadixConvert.H2X(123UL, 63));
            Assert.AreEqual(AnyRadixConvert.H2X(5UL, 2), "101");
            Assert.AreEqual(AnyRadixConvert.H2X(0, 2), "0");
            Assert.AreEqual(AnyRadixConvert.H2X(2, 2), "10");
            Assert.AreEqual(AnyRadixConvert.H2X(10, 10), "10");
            Assert.AreEqual(AnyRadixConvert.H2X(10, 16), "A");
        }
Exemplo n.º 2
0
 public void H2XTest()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => AnyRadixConvert.H2X(123UL, 0));
     Assert.Throws <ArgumentOutOfRangeException>(() => AnyRadixConvert.H2X(123UL, 63));
     Assert.Equal("101", AnyRadixConvert.H2X(5UL, 2));
     Assert.Equal("0", AnyRadixConvert.H2X(0, 2));
     Assert.Equal("10", AnyRadixConvert.H2X(2, 2));
     Assert.Equal("10", AnyRadixConvert.H2X(10, 10));
     Assert.Equal("A", AnyRadixConvert.H2X(10, 16));
 }