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); }
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); }
public void ContinuationWithoutReturnWithMultipleArguments() { IContinuation cont = new ParameterizedContinuationVoid<double,float> (FnAdd, 40d, 2f); Assert.AreEqual (null, cont.RunUntyped ()); Assert.AreEqual (42, x); }