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
Intermediate. Assumes working knowledge.
309K views8 years ago4 recommendations
Tools and practiceProgramming languagesTestingC# and .NET
Tim Corey demonstrates how to use mocking to unit test C# code with external dependencies like databases.
Unit tests are great, but how do you test your data access? You sure don't want to actually delete records when you are testing the delete method, yet you definitely want to be sure the method is configured properly. This is the type of problem that stops a lot of developers from creating unit tests. In this video, I am going to show you how to overcome these obstacles in order to write tests that handle working with external dependencies like databases. Full courses: DevForge.com/ Source Code: DevForge.com/downloads/?code=MockingInUnitTests Patreon: patreon.com/IAmTimCorey Newsletter signup: signup.iamtimcorey.com/ Sponsors: Tuhafeni Angula (Patreon Subscriber) - Intro - Getting started: demo application code and setup - Problems with testing methods that manipulates with external stuff (database edits, e-mail senders etc) - Mocking explained - Writing tests with mocking - Adding references for testing with MOCK - Using statement - AutoMock.GetLoose() vs AutoMock.GetStrict(); - Using AutoMock: Writing the Unit Test with mocking - Refactoring method that's under a UnitTest - Checking data: comparing two objects - Testing method that returns void - Testing SQl call modification - Recap - Advice for beginners - What not to test and why - Summary - Learning steps - Concluding remarksWhat people say. Recommended as a good primer for developers transitioning to unit testing and mocking in C#.
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/imp4l3rin r/dotnet • Recommends
On “How to efficiently Unit Test .net core WebApps?”
u/tokinblin r/dotnet • Recommends
On “Seeking advice: Should I use in memory database to test an horrible codebase?”