Ejemplo n.º 1
0
        public void Test_MulNegative_Success()
        {
            Rationals.Program r1 = new Rationals.Program(-4, 2);
            Rationals.Program r2 = new Rationals.Program(3, 7);
            r1.r1 = r1.Mul(r2.r1);

            Rationals.Program res = new Rationals.Program(-6, 7);
            Assert.AreEqual(res.ToString(), r1.ToString());
        }
Ejemplo n.º 2
0
 public void Test_MulToMuch_Failed()
 {
     Rationals.Program r1 = new Rationals.Program(4, 2);
     Rationals.Program r2 = new Rationals.Program(int.MaxValue);
     try
     {
         r1.r1 = r1.Mul(r2.r1);
         Assert.Fail();
     }
     catch (StackOverflowException)
     {
         Assert.IsTrue(true);
     }
 }