References - Testura/Testura.Code GitHub Wiki
References
There are five different reference classes inside Testura.Code:
VariableReference
- A simple variable referenceMemberReference
- A field or property on a classMethodReference
- A method on a classConstantReference
- A simple valueNullReference
- 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();