DefineVariable() public method

public DefineVariable ( string name, IType type ) : void
name string
type IType
return void
Beispiel #1
0
 public void DefineVariable()
 {
     IClass type = new BaseClass("int", null);
     IClass klass = new BaseClass("MyClass", null);
     klass.DefineVariable("age", type);
     var result = klass.GetVariableType("age");
     Assert.IsNotNull(result);
     Assert.AreEqual(type, result);
 }
Beispiel #2
0
 public void DefineVariableAndGetVariableFromSuper()
 {
     IClass type = new BaseClass("int", null);
     IClass super = new BaseClass("MySuperclass", null);
     IClass klass = new BaseClass("MyClass", super);
     super.DefineVariable("age", type);
     var result = klass.GetVariableType("age");
     Assert.IsNotNull(result);
     Assert.AreEqual(type, result);
 }
Beispiel #3
0
 public void RaiseIfVariableIsAlreadyDefined()
 {
     IClass type = new BaseClass("int", null);
     IClass klass = new BaseClass("MyClass", null);
     klass.DefineVariable("age", type);
     klass.DefineVariable("age", type);
 }