Skip to content

MaralMosafer/TDD-Csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TDD In C# With Examples

Building the software right 😉

  • XUnit
  • .NET Core 7
  • FizzBuz Example
  • EvenOrOdd Example
  • Crud Example (in memory db)

Give Me Star

If you find these explanations and examples helpful, please give me a star. Thank you!

What is TDD?

Test Driven Development (TDD) is a software development practice that focuses on creating unit test cases before developing the actual code. It is an iterative approach combining programming, unit test creation, and refactoring.

TDD

RED: The red phase is the starting point of the cycle, where you define expectations for the piece of code being tested, and let the test fail. Write tests starting at the lowest level, e.g. when the function is passed an empty array, return an empty array. Why let the test fail? So that you know you have written a good test - a test shouldn't be able to pass without any logic.

GREEN: Implement the necessary logic to make your test pass - don't worry about it being the most optimised or efficient at this stage, the goal is to pass the test!

REFACTOR: During the refactor phase, consider how you could optimise your code, without adding any additional functionality.

How TDD Help us?

  • to develop the logic in your code
  • Very high test-coverage
  • Improved quality of your code
  • Prevents bugs early on in the development process
  • Easy to add functionality to your code
  • Your code can be understood easily

You can easily practice with this project to learn TDD well. Enjoy it :)

About

Understanding of TDD(Test Driven Development) in C# With a few simple Practice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages