Skip to main content

Questions tagged [xunit]

0 votes
5 answers
535 views

I work on an organization's internal .NET Core 8 application where various dates are stored in different canonical formats, and some comparisons (checking that the current moment falls between a data ...
Green Grasso Holm's user avatar
0 votes
3 answers
290 views

This is a rewrite of my own .Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS? in a much more clear way: The reason for rewriting my previous question is because in the ...
Diego Perez's user avatar
3 votes
2 answers
690 views

I'm creating tests for our .Net 8 API. We use MySql for data storage and CQRS pattern for queries. In my personal opinion, I shouldn't use the real database for testing, because you will use an ...
Diego Perez's user avatar
1 vote
3 answers
829 views

This is something that I've heard a number of opinions and theories about, but I'm still torn on how to go forward. For context, this particular issue deals with the following technologies, in case ...
CrystalBlue's user avatar
128 votes
19 answers
19k views

I've been a software developer for 20+ years, although it's been an unusual career. I've mostly worked on either legacy projects, or small standalone, non-public-facing apps and so only a couple of ...
Edwardo's user avatar
  • 1,017
0 votes
1 answer
478 views

I am writing integration tests via unit tests by using Xunit. (the specific testing framework is not set in stone, Xunit is being used simply because it has been used before in this project team) The ...
Robin's user avatar
  • 103
20 votes
8 answers
9k views

Let's consider the following test. [Fact] public void MyTest() { // Arrange Code var sut = new SystemWeTest(); // Act Code var response = sut.Request(); // Assert ...
BAmadeusJ's user avatar
  • 326
71 votes
5 answers
25k views

Having worked in complex solutions that had Unit Tests and Integration Test in the CI/CD pipeline, I recall having a tough time with tests that failed randomly (either due to random values being ...
Vinicius Scheidegger's user avatar
4 votes
2 answers
2k views

I have the following code public class MyCollection<T> { public void Add(T obj) { ... } public int Count { get; } } and the following unit test to check whether Add increases the Count ...
user avatar
1 vote
4 answers
4k views

We are writing application service tests across our Data Service Class. Currently writing tests liking add Product, remove Product, check for inventory after sale, etc. They are all using the same ...
user avatar
-1 votes
1 answer
194 views

Here is my class library code which I have C# and xUnit. namespace XUnitSample.ClassLib { public class DataAccess : IDataAccess { public void AddPersonToPeopleList(List<Person> ...
Steve's user avatar
  • 309
1 vote
1 answer
522 views

I am trying to create a simple setup for xUnit. At the moment, the function does not access to database. So, here is my structure: I have 2 projects in my solution. First is my class library which is ...
Steve's user avatar
  • 309
-2 votes
1 answer
72 views

What is the meaning of: You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failure by Robert Martin on TDD? Is it write only the needed ...
Steve's user avatar
  • 309
4 votes
2 answers
6k views

I have looked through most of the answers given regarding using in-memory database for unit test, but I could not find one that was clear to me. I am writing some unit tests to cover some of our ...
elfico's user avatar
  • 153
0 votes
3 answers
659 views

I'm trying to unit test some repositories and have no idea what I'm doing if someone could point in the right direction that would be good, currently, I'm testing behaviour of creating a new user ...
bonivip695's user avatar

15 30 50 per page