References - Testura/Testura.Code GitHub Wiki

References

There are five different reference classes inside Testura.Code:

  • VariableReference - A simple variable reference
  • MemberReference - A field or property on a class
  • MethodReference - A method on a class
  • ConstantReference - A simple value
  • NullReference - A null value

Simple usage

The most simple case is to use them seperatly, for example:

Statement.Decleration.Assign("testVariable", new VariableReference("myVariable")));

Which will give you:

testVariable = myVariable;

Chain usage

Bur you can also chain then, for example:

Statement.Decleration.Assign("testVariable", new VariableReference("myVariable", new MemberReference("MyProperty", new MethodReference("MyMethod")));

Which will give you:

testVariable = myVariable.MyProperty.MyMethod();