예제 #1
0
 public void ContinuationWithoutReturn()
 {
     x = 0;
     IContinuation cont = new ParameterizedContinuationVoid<int> (FnSet, 42);
     Assert.AreEqual (null, cont.RunUntyped ());
     Assert.AreEqual (42, x);
 }
        public void ContinuationWithoutReturnWithMultipleArguments()
        {
            IContinuation cont = new ParameterizedContinuationVoid <double, float> (FnAdd, 40d, 2f);

            Assert.AreEqual(null, cont.RunUntyped());
            Assert.AreEqual(42, value);
        }
        public void ContinuationWithoutReturn()
        {
            value = 0;
            IContinuation cont = new ParameterizedContinuationVoid <int> (FnSet, 42);

            Assert.AreEqual(null, cont.RunUntyped());
            Assert.AreEqual(42, value);
        }
예제 #4
0
 public void ContinuationWithYield()
 {
     IContinuation cont = new ParameterizedContinuationVoid<int> (FnYield, 1234);
     int result = 0;
     try {
         cont.RunUntyped ();
     } catch (YieldException e) {
         result = (int)e.Continuation.RunUntyped ();
     }
     Assert.AreEqual (1234, result);
 }
        public void ContinuationWithYield()
        {
            IContinuation cont   = new ParameterizedContinuationVoid <int> (FnYield, 1234);
            int           result = 0;

            try {
                cont.RunUntyped();
            } catch (YieldException e) {
                result = (int)e.Continuation.RunUntyped();
            }
            Assert.AreEqual(1234, result);
        }
예제 #6
0
 public void ContinuationWithoutReturnWithMultipleArguments()
 {
     IContinuation cont = new ParameterizedContinuationVoid<double,float> (FnAdd, 40d, 2f);
     Assert.AreEqual (null, cont.RunUntyped ());
     Assert.AreEqual (42, x);
 }