public void Doit_retourner_id_class_que_operation() { var visitor = new ReturnVisitor(ref registry); var tmp = new OperandeVariable(classId, "num"); var tmp2 = new OperatorExpression(tmp, OPERATOR.EQUAL); Assert.AreEqual(classId, visitor.Visit(tmp2)); }
public void Doit_retourner_id_class_que_methode() { var visitor = new ReturnVisitor(ref registry); var tmpId = registry.AddPrimitiveClass("string", DATA_TYPE.STRING); cla.AddMethod("method", tmpId, new System.Collections.Generic.List<ClassesRegistry.Method.Argument.IArgument>()); var tmp = new OperandeVariable(classId, "num"); var tmp2 = new MethodExpression(tmp, registry.GetClassById(classId).InstanceMethods[0]); Assert.AreEqual(tmpId, visitor.Visit(tmp2)); }
public void Doit_retourner_id_boolean_pour_operateur_AND_OR_ARE_EQUAL() { var visitor = new ReturnVisitor(ref registry); var tmp3 = registry.AddPrimitiveClass("boolean", DATA_TYPE.BOOLEAN); var tmp = new OperandeVariable(classId, "num"); var tmp2 = new OperatorExpression(tmp, OPERATOR.AND); Assert.AreEqual(tmp3, visitor.Visit(tmp2)); tmp2 = new OperatorExpression(tmp, OPERATOR.OR); Assert.AreEqual(tmp3, visitor.Visit(tmp2)); tmp2 = new OperatorExpression(tmp, OPERATOR.ARE_EQUAL); Assert.AreEqual(tmp3, visitor.Visit(tmp2)); }
public void Doit_retourner_id_class_que_variable() { var visitor = new ReturnVisitor(ref registry); var tmp = new OperandeVariable(classId, "num"); Assert.AreEqual(classId, visitor.Visit(tmp)); }
public void Doit_retourner_id_class_que_constante() { var visitor = new ReturnVisitor(ref registry); var tmp = new OperandeConstante(classId, new DataTypeNumeric()); Assert.AreEqual(classId, visitor.Visit(tmp)); }