❔ Confused about one of my Unit Testing
Hello,
I'm doing a challenge to introduce myself into TDD but I'm getting struggling one of my unit test.
There the context :
__
Implementation of the business logic of a bank account:
Expected functionalities:
1. Money deposit
2. Money withdrawal
3. View current balance
4. Consult previous transactions
__
With my current solution architecture, I don't know how to develop the first test.
Pictures show how the service is developt.
8 Replies
Up
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Hi,
be more specific about ur question...
I have some general comments on those screens:
u may consider using
1.
ArgumentNullException.ThrowIfNull()
instead of this if
checks
2. try to follow the AAA
rule when u constructing tests as u can.
3. that _
after every single world in ur test case names is not preferred, u may want to read this article
https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practicesBest practices for writing unit tests - .NET
Learn best practices for writing unit tests that drive code quality and resilience for .NET Core and .NET Standard projects.
When it comes to tdd I follow a practice sometimes called red letter coding. You write tests and your system under test is literally all red letters as they don't exist, then you use refactoring tools to create classes, fill in implementations, etc.
can u recommend me a good resource for this practice, i am interesting to know more about it ?
I'm not finding anything that is awesome, but I've only done surface digging
Maybe I'll do a night of TDD on a voice channel
@Mayor McCheese nice, ill be happy if u mentioned me
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.