Top "Xunit" questions

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

.net core 2.0 ConfigureLogging xunit test

In my xUnit integration test in my .NET Core 2.0 project I cannot see log messages in the terminal that also …

c# logging asp.net-core xunit
Net Core: Execute All Dependency Injection in Xunit Test for AppService, Repository, etc

I am trying to implement Dependency Injection in Xunit test for AppService. Ideal goal is to run the original application …

c# .net asp.net-core .net-core xunit
Unit testing an AuthorizeAttribute on an ASP.NET Core MVC API controller

I have a ASP.NET Core MVC API with controllers that need to be unit tested. Controller: using Microsoft.AspNetCore.…

c# unit-testing .net-core asp.net-core-mvc xunit
Invoking Func passed as a parameter to a mock using Moq and C#

I have a mocked method that looks like this: class NotMineClass { T Execute(Func operation) { // do something return operation(); } } In …

c# .net moq capture xunit
How to Unit Test with ActionResult<T>?

I have a xUnit test like: [Fact] public async void GetLocationsCountAsync_WhenCalled_ReturnsLocationsCount() { _locationsService.Setup(s => s.GetLocationsCountAsync("123")).ReturnsAsync(10); …

c# unit-testing asp.net-core .net-core xunit
How to mock ActionExecutingContext with Moq?

I am trying to test the following filter: using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc.Filters; namespace Hello { public …

asp.net-mvc unit-testing moq xunit
In xUnit.net, is it possible to run tests in order?

I know you generally should not depend on order for your unit tests, but in xunit is it possible to …

unit-testing testing xunit.net xunit
xunit test Fact multiple times

I have some methods that rely on some random calculations to make a suggestion and I need to run the …

c# random xunit
ASP.NET Core Integration Testing & Mocking using Moq

I have the following ASP.NET Core integration test using a custom WebApplicationFactory public class CustomWebApplicationFactory<TEntryPoint> : WebApplicationFactory&…

asp.net-core asp.net-core-mvc moq xunit asp.net-core-testhost
why xunit not allow test a method with parameters?

I am learning to use unit test, i create a project, add xunit reference. And following codes: namespace UnitTestProject { public …

xunit