Created
March 16, 2012 02:36
-
-
Save jamesrcounts/2048180 to your computer and use it in GitHub Desktop.
A VS 11 DiffReporter for ApprovalTests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ApprovalTests.Reporters | |
{ | |
public class DevEnvDiffReporter : GenericDiffReporter | |
{ | |
public static readonly DevEnvDiffReporter INSTANCE = new DevEnvDiffReporter(); | |
public DevEnvDiffReporter() | |
: base( | |
"C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\devenv.exe", | |
"/diff \"{0}\" \"{1}\"", | |
"Only works with VS11") | |
{ | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ApprovalTests.Reporters; | |
using ApprovalUtilities.Utilities; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace ApprovalTests.Tests.Reporters | |
{ | |
[TestClass] | |
public class DevEnvDiffReporterTest | |
{ | |
[TestMethod] | |
[UseReporter(typeof(FileLauncherReporter))] | |
public void DevEnvTest() | |
{ | |
var dir = PathUtilities.GetDirectoryForCaller(); | |
string a = dir + "a.txt"; | |
System.IO.File.WriteAllText(a, "text a"); | |
string b = dir + "b.txt"; | |
System.IO.File.WriteAllText(b, "text b"); | |
var args = new DevEnvDiffReporter().GetLaunchArguments(a, b); | |
Approvals.VerifyWithCallback(args, launchargs => GenericDiffReporterTest.StartProcess(launchargs)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment