Last active
August 29, 2015 14:19
-
-
Save jpv001/d1a0d11d6bf94dc35d48 to your computer and use it in GitHub Desktop.
XUnit Linqpad Scaffold
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
void Main() | |
{ | |
XunitHelpers.LaunchXunitGui(Assembly.GetExecutingAssembly()); | |
} | |
#region Public XUnit Tests Here | |
public class TestThis | |
{ | |
[Fact] | |
public void TestStuff() | |
{ | |
Assert.True(true); | |
} | |
} | |
#endregion | |
#region XUnit | |
public static class XunitHelpers | |
{ | |
// Needs xunit that includes gui, which they stopped supporting at v2 - use this one https://xunit.codeplex.com/downloads/get/423827 | |
// Add the Xunit and Xunit.Extensions to the Additional Namespace Imports | |
public static void LaunchXunitGui(Assembly assembly) | |
{ | |
// change the path to your xunit location | |
var xunitLocation = @"C:\xunit-master\1.9.1\"; | |
const string xunitDllName = "xunit.dll"; | |
var cmd = string.Format(@"""{0}{1}"" ""{2}""", xunitLocation, @"xunit.gui.clr4.exe", assembly.Location); | |
if(!File.Exists(Path.Combine(Path.GetDirectoryName(assembly.Location), xunitDllName))) | |
File.Copy(string.Format(@"{0}{1}", xunitLocation, xunitDllName), Path.Combine(Path.GetDirectoryName(assembly.Location), xunitDllName)); | |
Util.Cmd (cmd); | |
} | |
} | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment