简体   繁体   中英

Visual Studio 2012 - Fill message test result

When a test end its running i have a list like this

Result1 Name:   01- AutoGenerateRequest (requestgenerationtest) 
Result1 Outcome:    Passed  
Result1 Duration:   0:00:26,2924949  
Result1 Message: 
Result1 StackTrace:

how can i write something in the result message or stacktrace?

I've found this solution

considering the TestContext that i have in my .cs file

private TestContext testContextInstance;
public TestContext TestContext
{
  get { return testContextInstance; }
  set { testContextInstance = value; }
}

i used this method

TestContext.WriteLine("message");

So in my output i see the message that i log.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM