I’ve got two separate unit tests in my TFS project. When I run all tests, I want the test functions to understand that they are part of a single test run. I’m not quite sure how the run would be identified. Maybe by a guid?
It might look something like this:
=== test1.cs ===
[TestClass]
public class Test1
{
[TestMethod]
public void verifyFoo()
{
int i = get_current_run_guid();
...
=== test2.cs ===
[TestClass]
public class Test2
{
[TestMethod]
public void verifyBar()
{
int i = get_current_run_guid();
...
Is this possible in TFS?
You can always have that giud in a shared static field.
Your tests can simply use it: