public void DecimalToHex_convertedCorrectly_NoExceptionsThrown() { Random random = new Random(); for (int i = 0; i < 50_000; i++) { int number = random.Next(i, int.MaxValue); Assert.DoesNotThrow(() => HexadecimalConvert.ConvertDecimalToHex(number), $"decimal {number} did not convert"); } }
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); } }
public void Hexadecimal_Case3_convertedCorrectly_DecimalValues() { var value = HexadecimalConvert.ConvertDecimalToHex(8500); Assert.AreEqual("2134", value); }
public void Hexadecimal_Case2_convertedCorrectly_DecimalValues() { var value = HexadecimalConvert.ConvertDecimalToHex(190); Assert.AreEqual("BE", value); }