u/Saltypoisonin r/dotnet • Recommends
On “Need resources to learn deep dive into tdd and unit testing with xunit and moq”
441K subscribers • 15 videos on Hallway
Beginner. No background in the topic needed.
449K views8 years ago3 recommendations
Tools and practiceTestingC# and .NET
Tim Corey explains the fundamentals of unit testing in C# using the xUnit framework, covering best practices and testable code design.
Unit testing is an important part of writing quality software. It is also a controversial and somewhat difficult topic to get started in. In this video, we walk through why we would use unit testing, what a unit test is, how to create a test, and how to deal with some of the more difficult situations. Along the way, we will cover best practices, the pitfalls to avoid, and how to write more testable code. This video uses XUnit instead of NUnit or MSTest based upon my preference. However, the techniques taught will apply to other test types. Newsletter signup (with exclusive discounts): signup.iamtimcorey.com/ (your email will be kept safe and you will not be spammed). Source Code (and homework): DevForge.com/downloads/?code=IntroToUnitTesting - Intro - Working environment - Demo application walk-through - Unit Testing explained - Creating a Unit Test project - Setting up a test - A bad Unit Test and Test Driven Development - Opinion on Unit Testing - Shortening Test name - "Theory": Test method parameters and arguments - Testing edge cases - Testing number division - Dividing by zero - Testing methods that can throw exceptions: method returns output - Debugging the Unit Test - Testing the exceptions: method throws exception - Testing the exceptions: method argument throws exception - Testing methods that do more than one thing: what is a Unit of work? - Breaking method in to individual methods, what to test and what not to test - "Add to List" Tests: working test - "Add to List" Tests: failing test - Homework - Concluding remarksWhat people say. Recommended as a great starter video and primer for learning unit testing and TDD with xUnit in .NET.
u/Saltypoisonin r/dotnet • Recommends
On “Need resources to learn deep dive into tdd and unit testing with xunit and moq”
u/r3ap4rin r/dotnet • Recommends
On “Are there any tutorials/courses on testing you would recommend?”
u/snakkerdkin r/dotnet • Recommends
On “Does integration testing in dot.net boil down to creating a mock repository class that just returns the value expected, and then import it instead of the actual one and then test it?”