private void button1_Click(object sender, EventArgs e) { try { if (RadioToBase16.Checked) { TxtOutPut.Text = HexadecimalConvert.ConvertToHexaDecimal(int.Parse(txtInput.Text)); } else { TxtOutPut.Text = HexadecimalConvert.ConvertHexToDecimal(txtInput.Text).ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void Hexadecimal_Case3_convertedCorrectly_DecimalValues() { var value = HexadecimalConvert.ConvertToHexaDecimal(8500); Assert.AreEqual("2134", value); }
public void Hexadecimal_Case2_convertedCorrectly_DecimalValues() { var value = HexadecimalConvert.ConvertToHexaDecimal(190); Assert.AreEqual("BE", value); }