UPDATE: Adding a 2019; the discovery/runner integration mechanism is same as per 2017 & 2015, so the key things that can go wrong are the same.
I've read Why is the xUnit runner not finding my tests, which covers reasons xUnit would never be able…
I have a large test suite in a .NET Core project. I can use the Test Explorer window to select a few tests to run.
I can also run the whole test suite on the command line with dotnet test. Is there a way to run only one (or a few) tests on the…
Context
in XUnit github I found this: Add Assert.Equal(expected, actual, message) overload #350 (so a developer ask for a non existing overload see below)
Quote from the answer:
We are a believer in self-documenting code; that includes your…
When you use [Theory] together with [InlineData] it will create a test for each item of inline data that is provided. However, if you use [MemberData] it will just show up as one test.
Is there a way to make [MemberData] tests show up as multiple…
I'm following this tutorial
Integration Testing with Entity Framework Core and SQL Server
My code looks like this
Integration Test Class
public class ControllerRequestsShould : IDisposable
{
private readonly TestServer _server;
private…
I am runnning all tests projects from solution level with a single command:
dotnet test how can I make all tests projects(assemblies) run in parallel?
In Visual Studio there is a simple button "Run tests in parallel" which works perfectly but I need…
I have this example test using xUnit:
[Fact]
public void SomeTest()
{
Assert.All(itemList, async item=>
{
var i = await Something(item);
Assert.Equal(item,i);
…
I'm using xUnit 2.0 collection fixtures to share a common database setup/teardown between a number of different test classes. The fixture also provides some helper properties, so I'm injecting it into each test class.
I recreated the example in the…
I am trying to do the following in an XUnit project to get the connectionstring to the database my tests should be using:
public class TestFixture : IDisposable
{
public IConfigurationRoot Configuration { get; set; }
public MyFixture()
…
I am really frustrated with this issue. I have already tried changing the version numbers but no tests are showing in the test explorer.
In the test output window I can see this output
Starting Microsoft.Framework.TestHost…
Unfortunately I have a Specflow test passing locally, but it fails on the VSO Build vNext server, and I really need to see verbose information during the test run so I can figure out what is going on.
But I'm struggling to try to inject…
When I run my tests today with xUnit v2, I typically use a naming convention like:
[Fact(DisplayName= "Method Will Do Something")]
public void Method_Will_Do_Something() { }
What extensibility point can I plug into that will allow me set my test…
This is a very strange problem that I have spent the day trying to track down. I am not sure if this is a bug, but it would be great to get some perspective and thoughts on why this is happening.
I am using xUnit (2.0) to run my unit tests. The…
Trying to test an ASPNET 5 application in VS2015.
{
"version": "1.0.0-*",
"description": "HoldingTank Class Library",
"dependencies": {
"EntityFramework.InMemory": "7.0.0-rc1-final",
"FluentAssertions": "4.1.1",
"GenFu": "1.0.4",
…
I am using xunit to do integration testing, and below is my test class.
public class CodesAndGuidelinesTest : IClassFixture
{
public readonly SchemaCache schemaCache;
public CodesAndGuidelinesTest(PostgreSqlResource resource)
…