コード例 #1
0
		public void RefalLibrary_TestSubInt32()
		{
			var refal = new RefalLibrary(null);
			var expr = PassiveExpression.Build(new OpeningBrace(), 321, new ClosingBrace(), 123);
			var result = refal.Sub(expr);

			Assert.AreEqual(result.Count, 1);
			Assert.IsTrue(result[0] is int);
			Assert.AreEqual((int)result[0], 198);
		}
コード例 #2
0
		public void RefalLibrary_TestSubInt32Negative()
		{
			var refal = new RefalLibrary(null);
			var expr = PassiveExpression.Build(new OpeningBrace(), 123, new ClosingBrace(), 321);
			var result = refal.Sub(expr);

			// result should be '-' 198 (two symbols)
			Assert.AreEqual(result.Count, 2);
			Assert.IsTrue(result[0] is char);
			Assert.IsTrue(result[1] is int);
			Assert.AreEqual((char)result[0], '-');
			Assert.AreEqual((int)result[1], 198);
		}