Skip to main content
Filter by
Sorted by
Tagged with
4 votes
0 answers
212 views

I have a solution with many projects. When I run dotnet test, it selects all my xUnit projects and seems to correctly execute all of them. But at the last line of what dotnet test prints, the number ...
FluidMechanics Potential Flows's user avatar
2 votes
2 answers
104 views

I am attempting to test a repository method using a moq with a setup in the test. As far as I can tell, this is not testing the method but only testing the test. Here is an abbreviated version of the ...
Jesse Liberty's user avatar
1 vote
0 answers
57 views

I am building a card game using Godot 4.5, with C#. I am trying to unit test a Card object that inherits from Node2D, but when I attempt to run the test, I get the following exception: Exception has ...
tbric123's user avatar
0 votes
0 answers
104 views

I am trying to use XUnit for testing my f# code. module UnitTest1 open Xunit open Program open System.Diagnostics [<Fact>] let Test1 () = Debugger.Break() Assert.True(true) The test ...
Andrey's user avatar
  • 6,639
0 votes
0 answers
33 views

In an xUnit theory I'd like to send an InlineData parameter of type string[][]. I can't seem to get it right. Is it doable, and if so, how? I would expect this to work at least: [InlineData(new string[...
Kjell Rilbe's user avatar
  • 1,623
0 votes
0 answers
70 views

I'm creating a new project with Keycloak and .NET Core 9. I've managed to get it working with my application, but I need to make it work with my integration tests. To integrate authorization and ...
BrePi's user avatar
  • 49
0 votes
0 answers
44 views

I have a maddening issue that I've been unable to find any help with doing the usual googling. Every time I go to Test Explorer in visual studio and select/right-click run a single unit test, it will ...
patso23's user avatar
0 votes
0 answers
41 views

When I run a xUnit.net v3 project on the command line it will list failed test but not passed tests. Is there an option or flag that I can set to show the names of the passed tests? C:\src\xxx\yyy\...
Donald Herman's user avatar
0 votes
2 answers
72 views

Given a simple .NET Console App like this: public class Program { public static void Main(string[] args) { Console.WriteLine("Hello World"); } } Can I write a unit test ...
James McCormack's user avatar
0 votes
1 answer
136 views

I developed an ASP.NET Core 8 MVC project and want to test all action methods using XUnit testing. But when I want to read data from the database using IDataReader, the code throws a ...
JagathNalin's user avatar
0 votes
1 answer
105 views

How to unit test this method: public PdfDocument GetPdf(string requestUrl) { var converter = new HtmlToPdf(); var response = converter.ConvertUrl(requestUrl); return response; } ...
Brook's user avatar
  • 39
0 votes
0 answers
46 views

I have two XUNIT trait categories on my tests. [Trait("HasDelay", "Yes"/"No")] [Trait("Category", "Integration"/"Unit")] I'm struggling to ...
Max's user avatar
  • 757
1 vote
1 answer
581 views

I am trying out the new-ish Microsoft.Testing.Platform in my C# unit tests. By default the platform does not produce TRX output, but there is an extension that allegedly provides TRX support: ...
Claus Appel's user avatar
  • 1,783
0 votes
1 answer
100 views

I'm learning how to write unit tests, please don't judge heavily. I have an API method below, written in C# for .NET 8.0, which I want to test. I use XUnit, Entity Framework Core 8, SQL Server 2019. ...
sam sergiy klok's user avatar
0 votes
0 answers
56 views

I am trying to run a test for my project that will need the whole API app to run by using process to start and run the application on a real TCP socket for eventual pact testing. The API seems to ...
Isaac Richardson's user avatar
2 votes
0 answers
52 views

I have next Fixture configuration code: private static IFixture CreateFixture() { var fixture = new Fixture(); fixture.Behaviors.OfType<ThrowingRecursionBehavior>().ToList() ....
Stanislav Molchanov's user avatar
0 votes
0 answers
96 views

I'm spinning up a WebApplicationFactory against our main API's Program.cs, mocking out services as needed, and then calling several integration tests against different endpoints. For the database, we'...
The Lemon's user avatar
  • 1,467
2 votes
0 answers
61 views

I am using XUnit with EF Core and Sqlite in .NET 9. During testing, several tests add data to the database and since they do it in parallel and add data in parallel, the tests get unexpected data from ...
Denis's user avatar
  • 21
2 votes
1 answer
174 views

I have an integration testing setup in .NET using xUnit v3, Testcontainers (for SQL Server), and MassTransit. My goal is to have: A single SQL container spun up once at the assembly level (using [...
georgink's user avatar
0 votes
0 answers
19 views

I have a BDDfytest ..... This.Given(_=> SomeInput(1)) .And(_=> AnotherInput(5)) .Bddfy():; ..... which generates standard output text like this Scenario: do something useful Given ...
Gurpreet's user avatar
  • 1,462
0 votes
1 answer
84 views

I tried to write test case for my DataAccess method containing QueryMultipleAsync but it being failed showing the error : Error : Message:  System.NotSupportedException : Unsupported expression: gr =&...
pixel4's user avatar
  • 1
2 votes
1 answer
241 views

I am writing XUnit integration tests for my ASP.NET Core Web API. I reconfigure my app in CustomWebApplicationFactory to replace original DbContext with the EFCore InMemoryDataBase like this: ...
Shkerbs's user avatar
  • 23
0 votes
0 answers
107 views

In my test suite, I'm dynamically skipping tests based on the presence of an environment variable called ASSSETGOV_TEST_MANUAL. This is a common pattern used to skip tests that should only be run ...
Shuzheng's user avatar
  • 14.6k
0 votes
0 answers
22 views

I do not have much experience with testing in .NET. I ran into an issue that I do not understand how to solve. Please advise where I can read about it. I have a backend code that works with a simple ...
Ira 's user avatar
  • 1
1 vote
2 answers
138 views

I’m trying to create integration tests in .NET 9 C# using xUnit and TestContainers. However, whenever I run the tests, a new database container is created for each test class. I want to initialize ...
BrePi's user avatar
  • 49

1
2 3 4 5
67