xunit Questions
3
Currently we are setting up a new project and like to use the new records introduced in C# 9.
We encounter a problem with DataAnnotations inside the record (constructor) not being triggered during ...
2
Solved
I'm facing to an issue when I'm running my unit tests on a VSTS build.
When I'm launching all my tests on Visual Studio locally, everything works fine. No error at all. Perfect.
But when I'm launch...
Simmonds asked 24/7, 2018 at 16:28
8
Solved
I'm using Visual Studio Code for a .NET Core Project.
I have an ASP.NET Core Project for which i want to create a separate unit tests project, i created a sub folder and ran
dotnet new xunit
dotne...
Gaol asked 16/7, 2017 at 11:8
10
Solved
I am completely stuck on this issue. So my team has a unit test project in a services test project. The tests are discovered in the test explorer pane however when I try and run the tests I get the...
Arrest asked 19/12, 2017 at 20:34
3
Solved
I have different test folders(packages). I want to setup and teardown some data for a specific package(folder).
The problem is set_up() is executed before running the test cases of that folder but...
Bohr asked 2/4, 2014 at 10:16
1
Solved
I have a simple health check test which looks like this:
public class HealthCheckEndpointTests : IClassFixture<ItemsApplicationFactory>
{
private readonly ItemsApplicationFactory _factory;
...
Jabiru asked 5/5, 2023 at 12:23
6
Solved
One of my unit tests has this signature:
public void FooWithFilter(string fooId, decimal? amount)
When I test it with null, it works:
[InlineData("123", null)]
But if I use an actual value, s...
2
Solved
I have a project with several large test cases in it and the project takes about 2-3 minutes to build. I am suspicious that it has to do with this new warnings feature... for example:
warning xU...
Dedal asked 14/6, 2017 at 14:20
3
Solved
I want to Unit Test my Controller, but I'm having issues reading values from HttpContext.Session.
I want to mock this piece from my Controller: HttpContext.Session.Get<int>(Foo)
With Mock Ht...
Rocket asked 16/1, 2019 at 12:37
3
I have 2 xunit tests I want to be ignored when triggering Run All Tests from VS, and to only run if the user ran it/them specifically.
I've tried using [Fact(Skip = "Long test, only run if needed,...
8
Solved
I'm currently converting my MsTest unit tests to xUnit. With xUnit, is there a way to test exception messages? Is it correct to test exception messages as opposed just the exception type?
Orfield asked 21/3, 2011 at 10:50
5
I'm trying to access gmail emails using imap and the code is failing at the ssl handshake without showing me any errors. Really appreciate if anyone could please help with this. I've built this usi...
2
Solved
I am quite new to c#, xUnit as well as Newtonsoft.Json. While I am trying compare two different JOject using Assert.Equal() method in unit test, it pass, refer to the below example code
using Newto...
3
Solved
I have the following unit test that I'm porting from a .Net Framework library to .Net core xunint test library. The project the unit test needs to be added to is
https://github.com/dotliquid/dotli...
Dibranchiate asked 13/9, 2017 at 13:16
5
Solved
I'm writing unit test. For testing the method below,
public async Task<Guid> CreateWebJobStatus(string blobId, Guid loggedInUserId, string loggedInUserEmail) {
Guid webJobStatusId = Guid....
Selfsufficient asked 7/3, 2018 at 1:6
6
Solved
I've been using NUnit for testing and I'm really fond of test cases. In NUnit you can easily set each test name in the test case using the SetName function in a TestCaseData class.
Does xUnit have...
Ponceau asked 14/10, 2017 at 20:43
2
Solved
Is there a way to Mock ProtectedSessionStorage in a Blazor Server Side project?
I tried below code but I am getting error : "Type to mock (ProtectedSessionStorage) must be an interface, a dele...
Owsley asked 6/4, 2022 at 14:57
5
Solved
I'm trying to test my controllers using xUnit but getting the following error during execution of Customer Controller:
"The following constructor parameters did not have matching fixture
data...
Hydrocarbon asked 3/7, 2018 at 13:35
6
Solved
I'm new to TDD and xUnit so I want to test my method that looks something like:
List<T> DeleteElements<T>(this List<T> a, List<T> b);
Is there any Assert method that I c...
2
I have an issue finding how to display tests according to class hierarchy in MS Test Runner (same in Resharper test runner) using XUnit.
I have structure similar to below example:
public class Ma...
Steffi asked 19/3, 2020 at 20:18
3
Solved
I'm using vs 2017, writing a netcoreapp2.0 library, and testing it with a UnitTest project (XUnit and NUnit give same results).
I've noticed that unless I'm forcefully Disposing of my Serilog logge...
2
Solved
I am trying to unit test a method within my controller in my Web API using XUnit. The role of the method is to get a single title, by ISBN, from the database. The issue I came across during unit te...
Beaded asked 25/5, 2020 at 9:23
6
Solved
I've created a EntityFramework ASP.NET solution and i'm trying to create a XUnit test project to test my differents classes i've created.
I've created a TestClass for my Activity Class :
using LADS...
Drona asked 24/3, 2022 at 14:27
9
Solved
I have an assembly that I've built on Windows
I want to run the xUnit tests on mono in Linux.
However, I have found that while 400 of these tests can run (in order), that certain tests either ha...
Romantic asked 12/12, 2010 at 11:4
4
Is there an easy way to convert an IEnumerable to TheoryData?
For example, if I want to pass the set of enumeration options, I'm looking for something like:
IEnumerable<TheoryData<MyEnum>&...
Midsummer asked 4/8, 2022 at 0:38
1 Next >
© 2022 - 2024 — McMap. All rights reserved.