Rank: Member
Groups: Registered
Joined: 3/24/2013(UTC) Posts: 19 Location: New Zealand
Thanks: 1 times Was thanked: 4 time(s) in 4 post(s)
|
I have a very simple C# project that contains the following code: Code:
namespace StringKata
{
using Xunit;
public class StringCalculator
{
public int Add(string numbers)
{
return 0;
}
}
public class StringCalculatorTests
{
[Fact]
public void Empty_string_is_zero()
{
var stringCalculator = new StringCalculator();
var actual = stringCalculator.Add("");
Assert.Equal(0, actual);
}
}
}
I have included a few nuget packages: Code:
<packages>
<package id="AutoFixture" version="3.0.8" targetFramework="net40" />
<package id="AutoFixture.AutoNSubstitute" version="3.0.8" targetFramework="net40" />
<package id="AutoFixture.Xunit" version="3.0.8" targetFramework="net40" />
<package id="NSubstitute" version="1.4.3.0" targetFramework="net40" />
<package id="xunit" version="1.9.1" targetFramework="net40" />
<package id="xunit.extensions" version="1.7.0.1540" targetFramework="net40" />
</packages>
I also use ReSharper 7.1 and have installed the xunit contrib plugin for resharper. But the build fails. I've set the output to verbose and this is what I get: Quote: Gallio.Model.ModelException: An exception occurred while invoking a test driver. ---> System.IO.FileNotFoundException: Could not load file or assembly 'xunit, Version=1.9.0.1566, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c' or one of its dependencies. The system cannot find the file specified. at Gallio.XunitAdapter.Model.XunitTestExplorer.TryGetTypeTest(ITypeInfo type, Test assemblyTest) at Gallio.XunitAdapter.Model.XunitTestExplorer.GetAssemblyTest(IAssemblyInfo assembly, Test parentTest, Version frameworkVersion, Boolean populateRecursively) at Gallio.XunitAdapter.Model.XunitTestExplorer.ExploreImpl(IReflectionPolicy reflectionPolicy, ICodeElementInfo codeElement) at Gallio.Model.Helpers.TestExplorer.Explore(IReflectionPolicy reflectionPolicy, ICodeElementInfo codeElement) at Gallio.Model.Helpers.SimpleTestDriver.GenerateTestModel(IReflectionPolicy reflectionPolicy, IEnumerable`1 codeElements, IMessageSink messageSink) at Gallio.Model.Helpers.SimpleTestDriver.DescribeImpl(IReflectionPolicy reflectionPolicy, IList`1 codeElements, TestExplorationOptions testExplorationOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) at Gallio.Model.BaseTestDriver.Describe(IReflectionPolicy reflectionPolicy, IList`1 codeElements, TestExplorationOptions testExplorationOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.<>c__DisplayClass17.<DescribeImpl>b__15(ITestDriver driver, IList`1 items, Int32 driverCount) at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ForEachDriver[T](MultiMap`2 testFrameworkPartitions, Func`4 func) --- End of inner exception stack trace --- at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ForEachDriver[T](MultiMap`2 testFrameworkPartitions, Func`4 func) at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.DescribeImpl(IReflectionPolicy reflectionPolicy, IList`1 codeElements, TestExplorationOptions testExplorationOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) at Gallio.Model.BaseTestDriver.Describe(IReflectionPolicy reflectionPolicy, IList`1 codeElements, TestExplorationOptions testExplorationOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) at nCrunch.TestExecution.Frameworks.Gallio.GallioWrapper.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths) at nCrunch.TestExecution.Frameworks.Gallio.GallioTestFramework.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths) at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths, TestFrameworkDescription[] frameworks) at nCrunch.Compiler.StaticManipulation.BuiltAssembly.DiscoverTests(TestFrameworkDescription[] applicableTestFrameworks) at nCrunch.Compiler.RemoteBuildRunner.#=qc19uOgHz4bbS00fHoJcJ86FdDfZxNpBz6hs6SLcoDgg=(ComponentBuildParameters #=qmVSC1mocuqkeMyG6RiWA7A==, String #=q6HotKBtAzAJ5NhAIJpJMWErw8$oIjiUT0yL0fTvBG1s=, BuildOutput #=qeo8ShH4FE1FNzdVk_FG0_g==, String #=qRmPlD1GldENhQyyoQ5tYKKyaUsmzaLiSqv0FdoKZIHA=, String[] #=qftBQ99WoQMP8nKBadgDENHqcE_v2YLLk_k2_mOUUIoM=) at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)
Based on this message and another forum post I'm assuming it's some kind of version collision, since the version of xUnit.net in nuget is 1.9.1. I'm rather keen to leverage some of the auto mocking capabilities that come from combining AutoFixture, xUnit.net, and NSubstitute as seen on Mark Seemann's blog. I've created a bug report for this issue too.
|