Skip to content

Instantly share code, notes, and snippets.

@jbevain
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbevain/c42dd13616117b9cd5a7 to your computer and use it in GitHub Desktop.
Save jbevain/c42dd13616117b9cd5a7 to your computer and use it in GitHub Desktop.
VSTU sample of Expression Evaluation tests
[Test]
public void StructInstanceMembers()
{
AssertExpressionsAtLine(21, "Types.cs", new Evaluations
{
{ "one",
Expect("one", Quoted("<X:1 Y:1 Z:1>"), "Victor",
Expect("X", "1f", "System.Single"),
Expect("Y", "1f", "System.Single"),
Expect("Z", "1f", "System.Single"))
},
});
}
[Test]
public void ObjectInstanceMembers()
{
AssertExpressionsAtLine(30, "Types.cs", new Evaluations
{
{ "i",
Expect("i", Quoted("Impl"), "Impl",
Expect("base", Quoted("Impl"), "Base",
Expect("BaseValue", Quoted("base"), "System.String"),
Expect("Non-Public members", "", "",
Expect("_base", Quoted("base"), "System.String"))),
Expect("ImplValue", Quoted("impl"), "System.String"),
Expect("Non-Public members", "", "",
Expect("_impl", Quoted("impl"), "System.String")))
},
});
}
@jbevain
Copy link
Author

jbevain commented Oct 3, 2014

Testing the way values will be displayed when debugging.

AssertExpressionsAtLine compiles a C# program, executes it in a forked VM with the debugger attached, and asserts that the expectations are met for an expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment