ApprovalTests DiffReporter is not popping up diff window when test is failed

1.2k Views Asked by At

ApprovalTests DiffReporter is not popping up diff window after running the test if the test is failed. Below is my code.

[UseReporter(typeof(DiffReporter))]
[TestClass]
public class ProjectEmployeeJsonTests
{
    [TestMethod]
    public void ToCommand()
    {
        var source = new EmployeeJson
        {
            firstName = "ABC",
            lastName = "TestCarrier"
        };

        var destination = new EmployeeCommand();
        var mapper = GetMapper();
        mapper.Execute(source, destination);

        Approvals.Verify(
            JsonConvert.SerializeObject(
                destination,
                Formatting.Indented));
    }
}

It pops up the diff window for the same code on one of my colleague's machine. We are using the same version of Visual studio with same settings and both of us do not have any diff tools installed.

However, I am able to run the test in VS 2012 (diff window popped up) but not in VS2013.

Versions: ApprovalTests.dll: 3.0.0.0 Visual studio: 2012 Professional, 2013 Professional

Any help here would be highly appreciated. Thanks!

2

There are 2 best solutions below

1
llewellyn falco On

Can you run this and see what happens?

Approvals.SetCaller();
Assert.IsTrue(VisualStudioReporter.INSTANCE.IsWorkingInThisEnvironment("a.txt"));
0
Deepak Ageeru On

As per the documentation, applying the "DiffReporter" attribute will "Launch an instance of the best matching DiffReporter on your system".

Not sure why it did not detect the diff merge reporter that comes with visual studio and Sourcegear's diff merge installed on my machine.

Installing tortoise svn worked for me, it pops up the diff window in tortoise diff tool now.