Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
146 views

I've found a strange behavior that I cannot understand. The code below is a reduction of the problem. The private async call method Listen() is normally a Method of an object that is called in a Test, ...
Kicest's user avatar
  • 9
0 votes
0 answers
112 views

When I run it by replacing the FirstOrDefaultAsync method with FirstOrDefault, the test works as expected. In other words, when I remove the asynchronous structure, my test runs correctly. However, ...
SenaTrks's user avatar
0 votes
1 answer
1k views

I am trying to mock Httpclient which is created inside a method with using keyword Please see the following sample. Public string testmethod(){ Using(Httpclient client = new Httpclient (){ Var ...
dev's user avatar
  • 195
0 votes
0 answers
77 views

I have a gherkin and specflow script that registers a user, then in the same script I need to get into an external resource to get the verification code.... If I break it all into 2 different scripts, ...
user384884's user avatar
1 vote
2 answers
437 views

Is there anyway to get the total numbers of tests in xunit? I know i can run the tests and get the value that way, but I just want to run a command to get the total amount of tests in my framework for ...
agleno's user avatar
  • 478
0 votes
1 answer
342 views

I have following test [Theory(DisplayName = nameof(GenerativeAnswersResponseAsync))] [InlineData("GenerativeAnswers1", GenerativeAnswers_InDomainTest, false, true)] [InlineData("...
VishalTest's user avatar
0 votes
0 answers
200 views

I have an api with a 'listing' method that supports some filtering capability. I wanted to write an integration test in xUnit that setup the data once in the database, then run several different ...
Terry's user avatar
  • 2,028
1 vote
1 answer
250 views

I am writing a small C# project that will count the coverage of all tests individually in a project with tests C#. To do this, I need to get a list of all the tests in the project in the ...
Marat Tim's user avatar
1 vote
0 answers
233 views

Unit tests fail surprisingly after no change with these exception after execution: System.TypeInitializationException: The type initializer for 'DiffEngine.ProcessCleanup' threw an exception. System....
AnneTest123's user avatar
0 votes
1 answer
809 views

I am trying to mock internal class for unit tests, due to some circular dependency I will not be able to use interface of this class to mock it, I also added unit test assembly name (made sure I am ...
Bhagyashri Nivdunge's user avatar
0 votes
1 answer
185 views

I have a OfflineHourlyDatabaseBackup BackgroundService in .NET 8 as shown below. OfflineHourlyDatabaseBackup: public class OfflineHourlyDatabaseBackup( ILogger<OfflineHourlyDatabaseBackup> ...
fingers10's user avatar
  • 8,449
0 votes
1 answer
585 views

Does anyone know if running parallel assemblies to true for xUnit will work with SonarCloud when collecting test coverage? Our unit tests are running long, so we found in the xUnit documentation that ...
Aoguye's user avatar
  • 71
0 votes
1 answer
187 views

I have a generic C# interface that I'm trying to mock with FakeItEasy for an xUnit test like this: #region FakeItEasyDebugging public interface IFakeTest<T> : IDisposable where T : new() ...
path's user avatar
  • 28
0 votes
1 answer
935 views

I have a pattern of xunit tests along these lines: a test class matching the class being tested subclasses for each method being tested a fixture to support artifacts needed for the test [Collection(...
Eric Patrick's user avatar
  • 2,307
1 vote
0 answers
195 views

I am using xUnit 2.6.3 (latest stable) to test a .Net 8 project. I have an object that inherits from an abstract class, and the method I'm testing has a return type of the base class. The base class ...
jvance's user avatar
  • 551
1 vote
0 answers
26 views

I want to set invariant culture for my test cases, at a test class level. What I did first is to create a base class for test classes, but it is instantiated for every test case, so culture is set/...
paradise's user avatar
  • 540
0 votes
1 answer
1k views

I am trying to run test project in Azure pipeline .My project use TestContainer library for Azure cosmos that only work ubuntu 18.04 although that VmImage version deprecated in Azure hosted agent. so ...
J Nguyen's user avatar
  • 147
1 vote
0 answers
36 views

I've been converting some existing tests to use Collection. I currently have a case though where I want to do something like this: [Collection("MyCollection")] public class SomeTests { ...
pseudodev's user avatar
  • 188
1 vote
1 answer
961 views

I have an API that I would like to make integration tests for. I have a Program.cs and a custom made Startup.cs which is basically a static class containing extension methods to WebApplicationBuilder ...
TheDoomDestroyer's user avatar
0 votes
1 answer
54 views

As a hobby project I'm building an app in .NET / C# that takes a bitmap, performs some operation, and saves the modified bitmap. Apart from the modification, this requires methods for turning the ...
Jan Hein de Jong's user avatar
1 vote
1 answer
341 views

So i was writing xUnit tests for my Asp.net Web Api application using FakeItEasy. Here is my Test which should return a List of MemberDto objects; public async Task ...
Natan's user avatar
  • 13
0 votes
1 answer
166 views

I have already Abp framework project without UI. And I am using HttpApi for create rest api And now i want have integration test for testing this project. But i don't know how to initiate this by ...
Night Fury's user avatar
1 vote
1 answer
116 views

My mock test is throwing a KeyNotFoundException: [Fact] public void MockAssembly_GetTypes_ReturnsMockedTypes() { var mockAssembly = new Mock<Assembly>(); mockAssembly.Setup(a => a....
AlwaysNeedingHelp's user avatar
0 votes
1 answer
359 views

I am trying to test the usage of our AutoMapper profiles in our project. I have an object Source which I map to Destination, actually it has about 30 properties, but for this example it will be fine ...
Wolfware's user avatar
  • 161
1 vote
1 answer
198 views

I'm using the EFCore 6.0.16 InMemory database provider to set up some tests, but I am encountering null reference issues when performing context.SaveChanges() on the scoped context after trying to add ...
Jimenemex's user avatar
  • 3,186

1
3 4
5
6 7
67