I have the following unit test:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MyModule.MyName.Tests
{
[TestClass()]
public class ClassName
{
[TestMethod()]
public void MethodName()
{
string dictString = //some value
System.Diagnostics.Debug.WriteLine("dictString is:");
System.Diagnostics.Debug.WriteLine(dictString);
Console.WriteLine("dictString is:");
Console.WriteLine(dictString);
//some assert
}
}
}
I am just trying to print the value of the variable dictString
from the test. However, nothing is printed.
When I select the test and run it, I get this in the Output
window:
[Informational] ========== Discover test finished: 1 found (0:00:01.6269603) ==========
[Informational] ------ Run test started ------
[Informational] ========== Run test finished: 1 run (0:00:00.8045498) ==========
None of my logging is printed. So, how can I print the values of the variables from the test?