Exemple #1
0
        private static void VerifyDivRemString(string opstring)
        {
            StackCalc sc = new StackCalc(opstring);

            while (sc.DoNextOperation())
            {
                Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
                sc.VerifyOutParameter();
            }
        }
 private static void VerifyDivRemString(string opstring)
 {
     try
     {
         StackCalc sc = new StackCalc(opstring);
         while (sc.DoNextOperation())
         {
             Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
             sc.VerifyOutParameter();
         }
     }
     catch (Exception e) when(!(e is DivideByZeroException))
     {
         // Log the original parameters, so we can reproduce any failure given the log
         throw new Exception($"VerifyDivRemString failed: {opstring} {e.ToString()}", e);
     }
 }
Exemple #3
0
 private static void VerifyDivRemString(string opstring)
 {
     try
     {
         StackCalc sc = new StackCalc(opstring);
         while (sc.DoNextOperation())
         {
             Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
             sc.VerifyOutParameter();
         }
     }
     catch(Exception e) when (!(e is DivideByZeroException))
     {
         // Log the original parameters, so we can reproduce any failure given the log
         throw new Exception($"VerifyDivRemString failed: {opstring} {e.ToString()}", e);
     }
 }
Exemple #4
0
 private static void VerifyDivRemString(string opstring)
 {
     StackCalc sc = new StackCalc(opstring);
     while (sc.DoNextOperation())
     {
         Assert.Equal(sc.snCalc.Peek().ToString(), sc.myCalc.Peek().ToString());
         sc.VerifyOutParameter();
     }
 }