MSTest with TestRunner inside LinqPad - Unresolved references in LinqPad.dll for a query
Hello there,
My goal is to run MsTests in LinqPad the same way I can NUnit inspired by this blog post( http://simoneb.github.io/blog/2012/10/28/nunit-via-linqpad/)
I have found this https://github.com/macro187/testrunner for running the tests via the console.
I managed to get it that far:
void Main()
{
// if is in the same process!
var testAsssembly = Assembly.GetExecutingAssembly().Location.Dump();
var testRunner = typeof(TestRunner.Program.TestResult).Assembly.Location.Dump();
Util.Cmd(testRunner, testAsssembly);
}
[TestClass]
public class Tests
{
[TestMethod]
public static void AlwaysTrue()
{
Assert.IsTrue(true);
}
}
with references added via NuGET:
MsTest.TestFramework, TestRunner
The error I get is :
"An internal error occurred in TestRunner.exe:
Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Type: System.IO.FileNotFoundException"
Out of curiosity I decompiled just the LinqPad.dll for the query in ILSpy (standalone) and found the same "unresolved" reference.
I would appreciate any help.
My goal is to run MsTests in LinqPad the same way I can NUnit inspired by this blog post( http://simoneb.github.io/blog/2012/10/28/nunit-via-linqpad/)
I have found this https://github.com/macro187/testrunner for running the tests via the console.
I managed to get it that far:
void Main()
{
// if is in the same process!
var testAsssembly = Assembly.GetExecutingAssembly().Location.Dump();
var testRunner = typeof(TestRunner.Program.TestResult).Assembly.Location.Dump();
Util.Cmd(testRunner, testAsssembly);
}
[TestClass]
public class Tests
{
[TestMethod]
public static void AlwaysTrue()
{
Assert.IsTrue(true);
}
}
with references added via NuGET:
MsTest.TestFramework, TestRunner
The error I get is :
"An internal error occurred in TestRunner.exe:
Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Type: System.IO.FileNotFoundException"
Out of curiosity I decompiled just the LinqPad.dll for the query in ILSpy (standalone) and found the same "unresolved" reference.
I would appreciate any help.
Comments
Go to Advanced and select 'Copy all non-framework references to a single local folder'
Also, I need you change your AlwaysTrue() method to be non-static.
Even the setting "Copy all non-framework references to a single local folder'" was saved in the snippet I created.