private void ApplyTest(int input, int expected) { KaprekarsConstant calculator = new KaprekarsConstant(input); calculator.debug = false; int result = calculator.GetResult(); Assert.AreEqual(result, expected); }
private void button1_Click(object sender, EventArgs e) { try { int answer = KaprekarsConstant.kaprekarsRoutine((int)numberInput.Value); lblAnswer.Text = answer.ToString(); } catch (InvalidOperationException) { MessageBox.Show("Read the rules then try again", "INVALID INPUT"); } }