示例#1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (RadioToBase16.Checked)
         {
             TxtOutPut.Text = HexadecimalConvert.ConvertDecimalToHex(int.Parse(txtInput.Text));
         }
         else
         {
             TxtOutPut.Text = HexadecimalConvert.ConvertHexToDecimal(txtInput.Text).ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
        public void Decimal_Case6_convertedCorrectly_ValuesHexValues()
        {
            var value = HexadecimalConvert.ConvertHexToDecimal("AAF0");

            Assert.AreEqual(43760, value);
        }
示例#3
0
        public void Decimal_Case7_convertedCorrectly_ValuesHexValues()
        {
            var value = HexadecimalConvert.ConvertHexToDecimal("A7F3");

            Assert.AreEqual(42995, value);
        }
示例#4
0
        public void Decimal_Case1_convertedCorrectly_ValuesHexValues()
        {
            var value = HexadecimalConvert.ConvertHexToDecimal("1");

            Assert.AreEqual(1, value);
        }