public void TestFunctionS() { var eng = new Engine.BaseTypes.Engine(0); var cell = eng.getPlayerCells()[2]; cell.setValue(new FunctionDbl()); var zero = new FunctionZero(); var one = new FunctionSucc().exec(zero); var two = new FunctionDbl().exec(one); var g = new FunctionDbl(); var f = new FunctionGet(); var part1 = new FunctionS().exec(f); var part2 = part1.exec(g); var res = part2.exec(two); Assert.AreEqual(true, res.isDigit()); Assert.AreEqual(8, (res as Digit).digit); }
public void TestFunctionsGetAndPut() { var eng = new Engine.BaseTypes.Engine(0); var get = new FunctionGet(); var resGet = get.exec(new Digit(0)); Assert.IsTrue(resGet is FunctionI); var put = new FunctionPut(); var resPut = put.exec(new Digit(10)); Assert.IsTrue(resGet is FunctionI); }