private void ApplyTest(int input, int expected)
        {
            KaprekarsConstant calculator = new KaprekarsConstant(input);
            calculator.debug = false;
            int result = calculator.GetResult();

            Assert.AreEqual(result, expected);
        }
Beispiel #2
0
 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");
     }
 }