Top "Xunit" questions

xUnit is the collection name for unit-testing compliant frameworks following a specific architecture.

xUnit framework: Equivalent of [TestFixtureSetUp] of NUnit in XUnit?

What is xUnit's equivalent of NUnit's [TestFixtureSetUp]? We have explored and found that IUseFixture<T> is the equivalent …

nunit xunit
C# WebApi Unit Testing and Mocking Controllers

I am working on this WebAPI project and I need to create unit tests for it. The base of the …

c# unit-testing asp.net-web-api moq xunit
Is it possible to use Dependency Injection with xUnit?

I have a test class with a constructor that needs an IService. public class ConsumerTests { private readonly IService _service; public …

unit-testing testing dependency-injection ioc-container xunit
Xunit The following constructor parameters did not have matching fixture data

I keep getting this error while using xunit for .NET 1.0 framework net46. The following constructor parameters did not have matching …

.net xunit
How to test web API JSON response?

I'm trying to setup unit tests for my web API. I've hacked together some test code from bits and pieces …

c# unit-testing asp.net-web-api xunit xunit.net
Xunit Unit Tests will not run

I am completely stuck on this issue. So my team has a unit test project in a services test project. …

c# .net windows-10 visual-studio-2017 xunit
How to implement XUnit descriptive Assert message?

Context in XUnit github I found this: Add Assert.Equal(expected, actual, message) overload #350 (so a developer ask for a …

c# unit-testing xunit assertions xunit2
How to get content value in Xunit when result returned in IActionResult type

I have a unit test project using Xunit and the method we are testing returns IActionResult. I saw some people …

c# unit-testing asp.net-core xunit asp.net-core-webapi
how to debug with xUnit?

I'm learning xUnit and so far, have found it to be a most useful tool. It's making me rethink some …

c# .net unit-testing debugging xunit
How to compare lists using fluent-assertions?

I want to compare a list of objects, ignoring the order of the objects in the list and only comparing …

c# unit-testing xunit fluent-assertions