Exemplo n.º 1
0
 public void _10To16Test()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => AnyRadixConvert._10To16(-1));
     Assert.Equal("0", AnyRadixConvert._10To16(0));
     Assert.Equal("01", AnyRadixConvert._10To16(1));
     Assert.Equal("0A", AnyRadixConvert._10To16(10));
     Assert.Equal("064", AnyRadixConvert._10To16(100));
 }
Exemplo n.º 2
0
        public void _10To16Test()
        {
//            Assert.Throws<ArgumentOutOfRangeException>(() => AnyRadixConvert._10To16(-1));
            Assert.AreEqual(AnyRadixConvert._10To16(0), "0");
            Assert.AreEqual(AnyRadixConvert._10To16(1), "01");
            Assert.AreEqual(AnyRadixConvert._10To16(10), "0A");
            Assert.AreEqual(AnyRadixConvert._10To16(100), "064");
        }
Exemplo n.º 3
0
        public override string ToString()
        {
            string result = Offset;

            if (BaseAddress != null)
            {
                result = BaseAddress.Name == "游戏基址"
                    ? AnyRadixConvert._10To16(AnyRadixConvert._16To10(BaseAddress.Offset) + AnyRadixConvert._16To10(Offset))
                    : string.Format("[{0}]+{1}", BaseAddress.ToString(), Offset);
            }
            return(string.IsNullOrEmpty(result) ? "0" : result.StartsWith("[") || result[0] == '0' ? result : '0' + result);
        }