Mastering C# Unit Testing with Real-world Examples

所在平台: Udemy

课程主页: https://www.udemy.com/course/mastering-csharp-unit-testing-with-real-world-examples/

课程评论:没有评论

第一个写评论        关注课程

课程简介

**课程名称:** 精通 C# 单元测试:实战案例分析 **课程概述:** 本课程专为希望提升 C# 单元测试技能、编写更具可读性和可维护性测试的开发者设计。与市面上许多只测试简单计算器类的教程不同,本课程将深入探讨如何测试真实世界的代码,包括包含依赖项、验证和边缘情况的代码。 通过对真实单元测试进行重构,您将学习如何将混乱、冗余的测试转化为清晰、易于理解和维护的测试。课程将运用最佳实践、成熟的原则和方法,帮助您优化测试代码,使其更易于遵循和理解。 **课程目标:** * 掌握使用 Builder 模式简化测试的方法。 * 学习如何编写测试多重测试值,提高测试的可维护性。 * 了解如何选择良好的命名规范和使用简单的测试值,使测试更易于理解。 * 学会编写领域特定的断言方法,增强测试的可读性。 **课程前提:** 本课程**不是**单元测试的入门课程。您应已掌握以下知识: * 使用 MSTest 等测试框架编写单元测试。 * 使用 Moq 等 Mocking 库。 * 理解 Arrange/Act/Assert 模式。 **课程内容:** * 涵盖单元测试不同最佳实践的八项原则/课程。 * 十余个展示真实代码案例的单元测试,这些测试需要进行重构。 * 四个练习,让您有机会独立应用所学知识来重构单元测试。 * 一个总结课程最佳实践的清单。 * 所有重构前的单元测试源代码,方便您跟随课程学习。

课程评论(0条)

课程详情

You've learned the basics of unit testing in C#, but you still struggle with writing tests that are easy to read and maintain.You've seen too many online tutorials testing a Calculator class, but you want to learn how to test real code. Code with dependencies, validations, and edge cases. Code that looks like the code you find every day at work.That's why I created this course.No more unit testing the Add method of a Calculator class.In this course, let's refactor some real unit tests to make them more readable and maintainable. Although I changed names, classes, and methods to avoid disclosing code from past clients and employers, these are the tests I had to work with as a software engineer. You will learn how to transform messy and convoluted tests into readable and maintainable tests using best practices and proven principles and methods.Who is this course for?This course is for you if you are:A C# developer who wants to level up your unit testing skills and write readable and maintainable testsA C# developer who is tired of boring and unrealistic tutorials and wants to learn from real code examplesAfter you follow this course, you will be able to:Use builder methods to simplify your testsWrite tests for multiple test values to make your tests more maintainableChoose good names and use simple test values to make your tests easier to followWrite domain-specific assertion methods to have more readable testsMastering these skills will help you to write tests easy to follow. The next time you open one of your tests, you won't need to scratch your head trying to figure out what you were doing.But here's the thing:This is not an introductory course on unit testing.You will take more out of this course if you know how to write unit tests with a testing framework like MSTest, a mocking library like Moq, and the Arrange/Act/Assert pattern.We're not covering how to write your first unit tests. We're covering unit testing best practices to make your tests readable and maintainable while we refactor real unit tests.If you know what mocks are in unit testing, you're in the right place.What is inside?In this course, you will get access to:Eight principles or lessons that cover different best practices for unit testingMore than ten unit tests that show real code examples that need refactoringFour exercises that challenge you to apply what you learned and refactor a unit test on your ownA checklist that summarizes the best practices from the courseSource code of all the unit tests before refactoring them so you can follow along each lesson

课程标签

0人关注该课程

主题相关的课程