Unit Testing for C# Developers

  • Course provided by Udemy
  • Study type: Online
  • Starts: Anytime
  • Price: See latest price on Udemy
Udemy

Course Description

Picture this: you make a simple change to the code and suddenly realize that you created a dozen unexpected bugs. Sound familiar? You’re not alone!

Good news is, unit testing can make this a thing of the past.

Maybe you’ve heard of automated or unit testing before and you’re keen to learn more.

Or perhaps you’ve tried to learn it and got a bit lost or ended up with fat and fragile tests that got in the way and slowed you down.

Either way, what you need is a course that will teach you all you need to know about this essential skill - from the basics, right through to mastery level.


What is unit testing?

In a nutshell: it’s the practice of writing code to test your code and then run those tests in an automated fashion.


Why learn unit testing?

Why write extra code? Wouldn’t that take extra time to write? Would that slow you down? Why not just run the application and test it like an end user?

Thinking like this is the mistake lots of people make. I used to make it myself. I’ve had to learn the hard way!

I learned pretty fast that if you’re building a complex application or working on a legacy app, manually testing all the various functions is tedious and takes a significant amount of time.


As your application grows, the cost of manual testing grows exponentially. And you’re never 100% sure if you’ve fully tested all the edge cases. You’re never confident that your code really works until you release your software and get a call from your boss or an end user!

Several studies have shown that the later a bug is caught in the software development lifecycle, the more costly it is to the business.

Automated tests help you to catch bugs earlier in the software development lifecycle, right when you’re coding. These tests are repeatable. Write them once and run them over and over.


The benefits of using unit tests are:

  • help you to catch and fix bugs earlier, before releasing your app into production
  • help you to write better code with less bugs
  • help you to produce software with better design - extensible and loosely-coupled
  • give you rapid feedback and tell you if your code *really* works
  • force you to think of edge cases that you didn’t realize existed
  • test your code much faster
  • tell if you have broken any functionality as you write new code
  • allow you to refactor your code with confidence
  • act as documentation about what your code does
  • save you both time and money


A valuable skill for senior developers

More and more companies are recognizing the advantages of automated testing, that’s why it’s a must-have for senior coders. If you’re looking to reach the higher levels in your coding career, this course can help.

You don’t need any prior knowledge of automated testing. You only need 3 months of experience programming in C#.


With this course you’ll learn:

  • senior coder secrets - best practices to write great unit tests
  • tips and tricks to keep your tests clean, trustworthy and maintainable
  • the pitfalls to avoid – anti-patterns
  • how to refactor legacy, untestable code into loosely-coupled and testable code
  • all about dependency injection – the one thing every coder needs to know
  • the power of mocks – when and how to use them and when to avoid


You’ll get:

  • 6 hours of HD video
  • tutorials and guidance from a senior coder with 15+ years’ experience
  • exercises with step-by-step solution
  • downloadable source code
  • lifetime access
  • access online or offline at any time on any device
  • certificate of completion to present to your current or prospective employer

Who this course is for:

  • Anyone who wants to build better quality software with fewer bugs
  • Any developers who want to transition to the senior level

Instructor

Passionate Software Engineer and Best-selling Author
  • 4.5 Instructor Rating
  • 224,418 Reviews
  • 536,711 Students
  • 20 Courses

Hi! My name is Mosh (Moshfegh) Hamedani! I'm a passionate software engineer with two decades of experience and I've taught over 3 million people who to code or how to become professional software engineers through my YouTube channel and online courses.

My goal is to make software engineering fun and accessible to everyone. That's why my courses are simple, pragmatic and free of BS.

Expected Outcomes

  1. Learn unit testing from scratch Tips and tricks to write clean, maintainable and trustworthy tests Write loosely-coupled and testable code Refactor legacy code towards testable code Understand and implement dependency injection Use mocks to isolate code from external dependencies Apply the unit testing best practices Learn the anti-patterns to avoid Curated for the Udemy Business collection Course content 8 sections • 86 lectures • 5h 48m total length Expand all sections Getting Started 14 lectures • 44min What is Automated Testing Preview 02:40 Benefits of Automated Testing Preview 02:37 Types of Tests Preview 04:00 Test Pyramid Preview 02:55 The Tooling 02:52 Source Code 00:15 Writing Your First Unit Test 10:27 Testing All the Execution Tests 05:22 Refactoring with Confidence 02:14 Using NUnit in Visual Studio 03:59 What is Test-Driven Development 03:19 Course Structure 01:46 Summary 00:41 Asking Questions 00:33 Fundamentals of Unit Testing 13 lectures • 39min Introduction 00:47 Characteristics of Good Unit Tests 02:03 What to Test and What Not to Test 03:00 Naming and Organizing Tests 02:36 Introducing Rider 01:52 Writing a Simple Unit Test 03:52 Black-box Testing 04:43 Set Up and Tear Down 03:36 Parameterized Tests 03:25 Ignoring Tests 01:33 Writing Trustworthy Tests 06:11 Developers Who Don't Write Tests 03:51 Summary 01:33 Core Unit Testing Techniques 11 lectures • 46min Introduction 00:32 Testing Strings 05:50 Testing Arrays and Collections 06:11 Testing the Return Type of Methods 04:02 Testing Void Methods 04:42 Testing Methods that Throw Exceptions 04:10 Testing Methods that Raise an Event 04:34 Testing Private Methods 09:50 Code Coverage 02:30 Testing in the Real-world 02:32 Summary 00:46 Exercises 6 lectures • 34min 19- Exercise- FizzBuzz 01:19 20- Solution- FizzBuzz 06:19 Exercise- DemeritPointsCalculator 00:54 Solution- DemeritPointsCalculator 09:43 Exercise- Stack 00:49 Solution- Stack 14:55 Breaking External Dependencies 14 lectures • 56min Introduction 02:16 Loosely-coupled and Testable Code 03:34 Refactoring Towards a Loosely-coupled Design 09:42 Dependency Injection via Method Parameters 05:09 Dependency Injection via Properties 02:41 Dependency Injection via Constructor 04:22 Dependency Injection Frameworks 03:26 Mocking Frameworks 01:55 Creating Mock Objects Using Moq 06:47 State-based vs. Interaction Testing 01:54 Testing the Interaction Between Two Objects 03:40 Fake as Little As Possible 03:10 An Example of a Mock Abuse 04:54 Who Should Write Tests 02:01 Exercises 9 lectures • 41min Exercise- VideoService 01:11 Refactoring 05:47 Testing 07:55 Exercise- InstallerHelper 01:26 Refactoring InstallerHelper 04:47 Testing InstallerHelper 08:05 Exercise- EmployeeHelper 02:37 Refactoring EmployeeController 05:24 Testing EmployeeController 04:00 Project- Testing BookingHelper 8 lectures • 36min Introduction 02:12 Test Cases 03:40 Extracting IBooking Repository 07:44 Writing the First Test 04:29 Refactoring 07:50 Writing the Second Test 01:28 Fixing a Bug 03:44 Writing Additional Tests 04:44 Project- HouseKeeperHelper 11 lectures • 54min Introduction 02:07 Refactoring For Testability 09:32 Fixing a Design Issue 02:59 An Alternative Solution 00:38 Writing the First Interaction Test 07:40 Keeping Tests Clean 05:42 Testing a Method is Not Called 05:37 Another Interaction Test 07:31 Extracting Helper Methods 08:02 Testing Exceptions 03:34 Coupons to My Other Courses Preview 00:20 Requirements Minimum 3 months programming in C# Description Picture this: you make a simple change to the code and suddenly realize that you created a dozen unexpected bugs. Sound familiar? You’re not alone! Good news is, unit testing can make this a thing of the past. Maybe you’ve heard of automated or unit testing before and you’re keen to learn more. Or perhaps you’ve tried to learn it and got a bit lost or ended up with fat and fragile tests that got in the way and slowed you down. Either way, what you need is a course that will teach you all you need to know about this essential skill - from the basics, right through to mastery level. What is unit testing? In a nutshell: it’s the practice of writing code to test your code and then run those tests in an automated fashion. Why learn unit testing? Why write extra code? Wouldn’t that take extra time to write? Would that slow you down? Why not just run the application and test it like an end user? Thinking like this is the mistake lots of people make. I used to make it myself. I’ve had to learn the hard way! I learned pretty fast that if you’re building a complex application or working on a legacy app, manually testing all the various functions is tedious and takes a significant amount of time. As your application grows, the cost of manual testing grows exponentially. And you’re never 100% sure if you’ve fully tested all the edge cases. You’re never confident that your code really works until you release your software and get a call from your boss or an end user! Several studies have shown that the later a bug is caught in the software development lifecycle, the more costly it is to the business. Automated tests help you to catch bugs earlier in the software development lifecycle , right when you’re coding. These tests are repeatable. Write them once and run them over and over. The benefits of using unit tests are: help you to catch and fix bugs earlier, before releasing your app into production help you to write better code with less bugs help you to produce software with better design - extensible and loosely-coupled give you rapid feedback and tell you if your code *really* works force you to think of edge cases that you didn’t realize existed test your code much faster tell if you have broken any functionality as you write new code allow you to refactor your code with confidence act as documentation about what your code does save you both time and money A valuable skill for senior developers More and more companies are recognizing the advantages of automated testing, that’s why it’s a must-have for senior coders. If you’re looking to reach the higher levels in your coding career, this course can help. You don’t need any prior knowledge of automated testing. You only need 3 months of experience programming in C#. With this course you’ll learn: senior coder secrets - best practices to write great unit tests tips and tricks to keep your tests clean, trustworthy and maintainable the pitfalls to avoid – anti-patterns how to refactor legacy, untestable code into loosely-coupled and testable code all about dependency injection – the one thing every coder needs to know the power of mocks – when and how to use them and when to avoid You’ll get: 6 hours of HD video tutorials and guidance from a senior coder with 15+ years’ experience exercises with step-by-step solution downloadable source code lifetime access access online or offline at any time on any device certificate of completion to present to your current or prospective employer Who this course is for: Anyone who wants to build better quality software with fewer bugs Any developers who want to transition to the senior level Show more Show less Featured review Razique 25 courses 5 reviews Rating: 5.0 out of 5 a year ago This is a great course on unit testing. The theory is there, so the hands-on. A lot of coding, and chances to practices the skills learned. I took this one right after the advanced course, and I have to say that I still needed to wrap my head around certain things. What I like about Mosh, as usual, is his passion and experience. That shows in how clean and efficient the code is. Thank you so much for creating such an amazing course. Show more Show less Instructor Mosh Hamedani Passionate Software Engineer and Best-selling Author 4.5 Instructor Rating 224,418 Reviews 536,711 Students 20 Courses Hi! My name is Mosh (Moshfegh) Hamedani! I'm a passionate software engineer with two decades of experience and I've taught over 3 million people who to code or how to become professional software engineers through my YouTube channel and online courses. My goal is to make software engineering fun and accessible to everyone. That's why my courses are simple, pragmatic and free of BS. Show more Show less Udemy Business Teach on Udemy Get the app About us Contact us Careers Blog Help and Support Affiliate Impressum Kontakt Terms Privacy policy Cookie settings Sitemap © 2021 Udemy, Inc. window.handleCSSToggleButtonClick = function (event) { var target = event.currentTarget; var cssToggleId = target && target.dataset && target.dataset.cssToggleId; var input = cssToggleId && document.getElementById(cssToggleId); if (input) { if (input.dataset.type === 'checkbox') { input.dataset.checked = input.dataset.checked ? '' : 'checked'; } else { input.dataset.checked = input.dataset.allowToggle && input.dataset.checked ? '' : 'checked'; var radios = document.querySelectorAll('[name="' + input.dataset.name + '"]'); for (var i = 0; i (function(){window['__CF$cv$params']={r:'677700bf2bf153b0',m:'541a2db1a51e0174d70337e8a16c19d0b292ffc0-1627736356-1800-AZ2Ma3E4XK8D+co2uKsfVrHndVD27jAVsNnwVy62KNkjvBQmLkhDcG2AUiLbdXnZ86O20IXlrKmR8/cwXly3+K/qkgQamuHDijkGWeoxj5la1nPe2HpKZp7n35zYlQ6C6oL2vpL0idVDegfuKN1IAEs=',s:[0x9243c1295c,0x81360ad2ed],}})();
  2. Tips and tricks to write clean, maintainable and trustworthy tests Write loosely-coupled and testable code Refactor legacy code towards testable code Understand and implement dependency injection Use mocks to isolate code from external dependencies Apply the unit testing best practices Learn the anti-patterns to avoid Curated for the Udemy Business collection Course content 8 sections • 86 lectures • 5h 48m total length Expand all sections Getting Started 14 lectures • 44min What is Automated Testing Preview 02:40 Benefits of Automated Testing Preview 02:37 Types of Tests Preview 04:00 Test Pyramid Preview 02:55 The Tooling 02:52 Source Code 00:15 Writing Your First Unit Test 10:27 Testing All the Execution Tests 05:22 Refactoring with Confidence 02:14 Using NUnit in Visual Studio 03:59 What is Test-Driven Development 03:19 Course Structure 01:46 Summary 00:41 Asking Questions 00:33 Fundamentals of Unit Testing 13 lectures • 39min Introduction 00:47 Characteristics of Good Unit Tests 02:03 What to Test and What Not to Test 03:00 Naming and Organizing Tests 02:36 Introducing Rider 01:52 Writing a Simple Unit Test 03:52 Black-box Testing 04:43 Set Up and Tear Down 03:36 Parameterized Tests 03:25 Ignoring Tests 01:33 Writing Trustworthy Tests 06:11 Developers Who Don't Write Tests 03:51 Summary 01:33 Core Unit Testing Techniques 11 lectures • 46min Introduction 00:32 Testing Strings 05:50 Testing Arrays and Collections 06:11 Testing the Return Type of Methods 04:02 Testing Void Methods 04:42 Testing Methods that Throw Exceptions 04:10 Testing Methods that Raise an Event 04:34 Testing Private Methods 09:50 Code Coverage 02:30 Testing in the Real-world 02:32 Summary 00:46 Exercises 6 lectures • 34min 19- Exercise- FizzBuzz 01:19 20- Solution- FizzBuzz 06:19 Exercise- DemeritPointsCalculator 00:54 Solution- DemeritPointsCalculator 09:43 Exercise- Stack 00:49 Solution- Stack 14:55 Breaking External Dependencies 14 lectures • 56min Introduction 02:16 Loosely-coupled and Testable Code 03:34 Refactoring Towards a Loosely-coupled Design 09:42 Dependency Injection via Method Parameters 05:09 Dependency Injection via Properties 02:41 Dependency Injection via Constructor 04:22 Dependency Injection Frameworks 03:26 Mocking Frameworks 01:55 Creating Mock Objects Using Moq 06:47 State-based vs. Interaction Testing 01:54 Testing the Interaction Between Two Objects 03:40 Fake as Little As Possible 03:10 An Example of a Mock Abuse 04:54 Who Should Write Tests 02:01 Exercises 9 lectures • 41min Exercise- VideoService 01:11 Refactoring 05:47 Testing 07:55 Exercise- InstallerHelper 01:26 Refactoring InstallerHelper 04:47 Testing InstallerHelper 08:05 Exercise- EmployeeHelper 02:37 Refactoring EmployeeController 05:24 Testing EmployeeController 04:00 Project- Testing BookingHelper 8 lectures • 36min Introduction 02:12 Test Cases 03:40 Extracting IBooking Repository 07:44 Writing the First Test 04:29 Refactoring 07:50 Writing the Second Test 01:28 Fixing a Bug 03:44 Writing Additional Tests 04:44 Project- HouseKeeperHelper 11 lectures • 54min Introduction 02:07 Refactoring For Testability 09:32 Fixing a Design Issue 02:59 An Alternative Solution 00:38 Writing the First Interaction Test 07:40 Keeping Tests Clean 05:42 Testing a Method is Not Called 05:37 Another Interaction Test 07:31 Extracting Helper Methods 08:02 Testing Exceptions 03:34 Coupons to My Other Courses Preview 00:20 Requirements Minimum 3 months programming in C# Description Picture this: you make a simple change to the code and suddenly realize that you created a dozen unexpected bugs. Sound familiar? You’re not alone! Good news is, unit testing can make this a thing of the past. Maybe you’ve heard of automated or unit testing before and you’re keen to learn more. Or perhaps you’ve tried to learn it and got a bit lost or ended up with fat and fragile tests that got in the way and slowed you down. Either way, what you need is a course that will teach you all you need to know about this essential skill - from the basics, right through to mastery level. What is unit testing? In a nutshell: it’s the practice of writing code to test your code and then run those tests in an automated fashion. Why learn unit testing? Why write extra code? Wouldn’t that take extra time to write? Would that slow you down? Why not just run the application and test it like an end user? Thinking like this is the mistake lots of people make. I used to make it myself. I’ve had to learn the hard way! I learned pretty fast that if you’re building a complex application or working on a legacy app, manually testing all the various functions is tedious and takes a significant amount of time. As your application grows, the cost of manual testing grows exponentially. And you’re never 100% sure if you’ve fully tested all the edge cases. You’re never confident that your code really works until you release your software and get a call from your boss or an end user! Several studies have shown that the later a bug is caught in the software development lifecycle, the more costly it is to the business. Automated tests help you to catch bugs earlier in the software development lifecycle , right when you’re coding. These tests are repeatable. Write them once and run them over and over. The benefits of using unit tests are: help you to catch and fix bugs earlier, before releasing your app into production help you to write better code with less bugs help you to produce software with better design - extensible and loosely-coupled give you rapid feedback and tell you if your code *really* works force you to think of edge cases that you didn’t realize existed test your code much faster tell if you have broken any functionality as you write new code allow you to refactor your code with confidence act as documentation about what your code does save you both time and money A valuable skill for senior developers More and more companies are recognizing the advantages of automated testing, that’s why it’s a must-have for senior coders. If you’re looking to reach the higher levels in your coding career, this course can help. You don’t need any prior knowledge of automated testing. You only need 3 months of experience programming in C#. With this course you’ll learn: senior coder secrets - best practices to write great unit tests tips and tricks to keep your tests clean, trustworthy and maintainable the pitfalls to avoid – anti-patterns how to refactor legacy, untestable code into loosely-coupled and testable code all about dependency injection – the one thing every coder needs to know the power of mocks – when and how to use them and when to avoid You’ll get: 6 hours of HD video tutorials and guidance from a senior coder with 15+ years’ experience exercises with step-by-step solution downloadable source code lifetime access access online or offline at any time on any device certificate of completion to present to your current or prospective employer Who this course is for: Anyone who wants to build better quality software with fewer bugs Any developers who want to transition to the senior level Show more Show less Featured review Razique 25 courses 5 reviews Rating: 5.0 out of 5 a year ago This is a great course on unit testing. The theory is there, so the hands-on. A lot of coding, and chances to practices the skills learned. I took this one right after the advanced course, and I have to say that I still needed to wrap my head around certain things. What I like about Mosh, as usual, is his passion and experience. That shows in how clean and efficient the code is. Thank you so much for creating such an amazing course. Show more Show less Instructor Mosh Hamedani Passionate Software Engineer and Best-selling Author 4.5 Instructor Rating 224,418 Reviews 536,711 Students 20 Courses Hi! My name is Mosh (Moshfegh) Hamedani! I'm a passionate software engineer with two decades of experience and I've taught over 3 million people who to code or how to become professional software engineers through my YouTube channel and online courses. My goal is to make software engineering fun and accessible to everyone. That's why my courses are simple, pragmatic and free of BS. Show more Show less Udemy Business Teach on Udemy Get the app About us Contact us Careers Blog Help and Support Affiliate Impressum Kontakt Terms Privacy policy Cookie settings Sitemap © 2021 Udemy, Inc. window.handleCSSToggleButtonClick = function (event) { var target = event.currentTarget; var cssToggleId = target && target.dataset && target.dataset.cssToggleId; var input = cssToggleId && document.getElementById(cssToggleId); if (input) { if (input.dataset.type === 'checkbox') { input.dataset.checked = input.dataset.checked ? '' : 'checked'; } else { input.dataset.checked = input.dataset.allowToggle && input.dataset.checked ? '' : 'checked'; var radios = document.querySelectorAll('[name="' + input.dataset.name + '"]'); for (var i = 0; i (function(){window['__CF$cv$params']={r:'677700bf2bf153b0',m:'541a2db1a51e0174d70337e8a16c19d0b292ffc0-1627736356-1800-AZ2Ma3E4XK8D+co2uKsfVrHndVD27jAVsNnwVy62KNkjvBQmLkhDcG2AUiLbdXnZ86O20IXlrKmR8/cwXly3+K/qkgQamuHDijkGWeoxj5la1nPe2HpKZp7n35zYlQ6C6oL2vpL0idVDegfuKN1IAEs=',s:[0x9243c1295c,0x81360ad2ed],}})();
  3. Write loosely-coupled and testable code Refactor legacy code towards testable code Understand and implement dependency injection Use mocks to isolate code from external dependencies Apply the unit testing best practices Learn the anti-patterns to avoid Curated for the Udemy Business collection Course content 8 sections • 86 lectures • 5h 48m total length Expand all sections Getting Started 14 lectures • 44min What is Automated Testing Preview 02:40 Benefits of Automated Testing Preview 02:37 Types of Tests Preview 04:00 Test Pyramid Preview 02:55 The Tooling 02:52 Source Code 00:15 Writing Your First Unit Test 10:27 Testing All the Execution Tests 05:22 Refactoring with Confidence 02:14 Using NUnit in Visual Studio 03:59 What is Test-Driven Development 03:19 Course Structure 01:46 Summary 00:41 Asking Questions 00:33 Fundamentals of Unit Testing 13 lectures • 39min Introduction 00:47 Characteristics of Good Unit Tests 02:03 What to Test and What Not to Test 03:00 Naming and Organizing Tests 02:36 Introducing Rider 01:52 Writing a Simple Unit Test 03:52 Black-box Testing 04:43 Set Up and Tear Down 03:36 Parameterized Tests 03:25 Ignoring Tests 01:33 Writing Trustworthy Tests 06:11 Developers Who Don't Write Tests 03:51 Summary 01:33 Core Unit Testing Techniques 11 lectures • 46min Introduction 00:32 Testing Strings 05:50 Testing Arrays and Collections 06:11 Testing the Return Type of Methods 04:02 Testing Void Methods 04:42 Testing Methods that Throw Exceptions 04:10 Testing Methods that Raise an Event 04:34 Testing Private Methods 09:50 Code Coverage 02:30 Testing in the Real-world 02:32 Summary 00:46 Exercises 6 lectures • 34min 19- Exercise- FizzBuzz 01:19 20- Solution- FizzBuzz 06:19 Exercise- DemeritPointsCalculator 00:54 Solution- DemeritPointsCalculator 09:43 Exercise- Stack 00:49 Solution- Stack 14:55 Breaking External Dependencies 14 lectures • 56min Introduction 02:16 Loosely-coupled and Testable Code 03:34 Refactoring Towards a Loosely-coupled Design 09:42 Dependency Injection via Method Parameters 05:09 Dependency Injection via Properties 02:41 Dependency Injection via Constructor 04:22 Dependency Injection Frameworks 03:26 Mocking Frameworks 01:55 Creating Mock Objects Using Moq 06:47 State-based vs. Interaction Testing 01:54 Testing the Interaction Between Two Objects 03:40 Fake as Little As Possible 03:10 An Example of a Mock Abuse 04:54 Who Should Write Tests 02:01 Exercises 9 lectures • 41min Exercise- VideoService 01:11 Refactoring 05:47 Testing 07:55 Exercise- InstallerHelper 01:26 Refactoring InstallerHelper 04:47 Testing InstallerHelper 08:05 Exercise- EmployeeHelper 02:37 Refactoring EmployeeController 05:24 Testing EmployeeController 04:00 Project- Testing BookingHelper 8 lectures • 36min Introduction 02:12 Test Cases 03:40 Extracting IBooking Repository 07:44 Writing the First Test 04:29 Refactoring 07:50 Writing the Second Test 01:28 Fixing a Bug 03:44 Writing Additional Tests 04:44 Project- HouseKeeperHelper 11 lectures • 54min Introduction 02:07 Refactoring For Testability 09:32 Fixing a Design Issue 02:59 An Alternative Solution 00:38 Writing the First Interaction Test 07:40 Keeping Tests Clean 05:42 Testing a Method is Not Called 05:37 Another Interaction Test 07:31 Extracting Helper Methods 08:02 Testing Exceptions 03:34 Coupons to My Other Courses Preview 00:20 Requirements Minimum 3 months programming in C# Description Picture this: you make a simple change to the code and suddenly realize that you created a dozen unexpected bugs. Sound familiar? You’re not alone! Good news is, unit testing can make this a thing of the past. Maybe you’ve heard of automated or unit testing before and you’re keen to learn more. Or perhaps you’ve tried to learn it and got a bit lost or ended up with fat and fragile tests that got in the way and slowed you down. Either way, what you need is a course that will teach you all you need to know about this essential skill - from the basics, right through to mastery level. What is unit testing? In a nutshell: it’s the practice of writing code to test your code and then run those tests in an automated fashion. Why learn unit testing? Why write extra code? Wouldn’t that take extra time to write? Would that slow you down? Why not just run the application and test it like an end user? Thinking like this is the mistake lots of people make. I used to make it myself. I’ve had to learn the hard way! I learned pretty fast that if you’re building a complex application or working on a legacy app, manually testing all the various functions is tedious and takes a significant amount of time. As your application grows, the cost of manual testing grows exponentially. And you’re never 100% sure if you’ve fully tested all the edge cases. You’re never confident that your code really works until you release your software and get a call from your boss or an end user! Several studies have shown that the later a bug is caught in the software development lifecycle, the more costly it is to the business. Automated tests help you to catch bugs earlier in the software development lifecycle , right when you’re coding. These tests are repeatable. Write them once and run them over and over. The benefits of using unit tests are: help you to catch and fix bugs earlier, before releasing your app into production help you to write better code with less bugs help you to produce software with better design - extensible and loosely-coupled give you rapid feedback and tell you if your code *really* works force you to think of edge cases that you didn’t realize existed test your code much faster tell if you have broken any functionality as you write new code allow you to refactor your code with confidence act as documentation about what your code does save you both time and money A valuable skill for senior developers More and more companies are recognizing the advantages of automated testing, that’s why it’s a must-have for senior coders. If you’re looking to reach the higher levels in your coding career, this course can help. You don’t need any prior knowledge of automated testing. You only need 3 months of experience programming in C#. With this course you’ll learn: senior coder secrets - best practices to write great unit tests tips and tricks to keep your tests clean, trustworthy and maintainable the pitfalls to avoid – anti-patterns how to refactor legacy, untestable code into loosely-coupled and testable code all about dependency injection – the one thing every coder needs to know the power of mocks – when and how to use them and when to avoid You’ll get: 6 hours of HD video tutorials and guidance from a senior coder with 15+ years’ experience exercises with step-by-step solution downloadable source code lifetime access access online or offline at any time on any device certificate of completion to present to your current or prospective employer Who this course is for: Anyone who wants to build better quality software with fewer bugs Any developers who want to transition to the senior level Show more Show less Featured review Razique 25 courses 5 reviews Rating: 5.0 out of 5 a year ago This is a great course on unit testing. The theory is there, so the hands-on. A lot of coding, and chances to practices the skills learned. I took this one right after the advanced course, and I have to say that I still needed to wrap my head around certain things. What I like about Mosh, as usual, is his passion and experience. That shows in how clean and efficient the code is. Thank you so much for creating such an amazing course. Show more Show less Instructor Mosh Hamedani Passionate Software Engineer and Best-selling Author 4.5 Instructor Rating 224,418 Reviews 536,711 Students 20 Courses Hi! My name is Mosh (Moshfegh) Hamedani! I'm a passionate software engineer with two decades of experience and I've taught over 3 million people who to code or how to become professional software engineers through my YouTube channel and online courses. My goal is to make software engineering fun and accessible to everyone. That's why my courses are simple, pragmatic and free of BS. Show more Show less Udemy Business Teach on Udemy Get the app About us Contact us Careers Blog Help and Support Affiliate Impressum Kontakt Terms Privacy policy Cookie settings Sitemap © 2021 Udemy, Inc. window.handleCSSToggleButtonClick = function (event) { var target = event.currentTarget; var cssToggleId = target && target.dataset && target.dataset.cssToggleId; var input = cssToggleId && document.getElementById(cssToggleId); if (input) { if (input.dataset.type === 'checkbox') { input.dataset.checked = input.dataset.checked ? '' : 'checked'; } else { input.dataset.checked = input.dataset.allowToggle && input.dataset.checked ? '' : 'checked'; var radios = document.querySelectorAll('[name="' + input.dataset.name + '"]'); for (var i = 0; i (function(){window['__CF$cv$params']={r:'677700bf2bf153b0',m:'541a2db1a51e0174d70337e8a16c19d0b292ffc0-1627736356-1800-AZ2Ma3E4XK8D+co2uKsfVrHndVD27jAVsNnwVy62KNkjvBQmLkhDcG2AUiLbdXnZ86O20IXlrKmR8/cwXly3+K/qkgQamuHDijkGWeoxj5la1nPe2HpKZp7n35zYlQ6C6oL2vpL0idVDegfuKN1IAEs=',s:[0x9243c1295c,0x81360ad2ed],}})();
  4. Refactor legacy code towards testable code Understand and implement dependency injection Use mocks to isolate code from external dependencies Apply the unit testing best practices Learn the anti-patterns to avoid Curated for the Udemy Business collection Course content 8 sections • 86 lectures • 5h 48m total length Expand all sections Getting Started 14 lectures • 44min What is Automated Testing Preview 02:40 Benefits of Automated Testing Preview 02:37 Types of Tests Preview 04:00 Test Pyramid Preview 02:55 The Tooling 02:52 Source Code 00:15 Writing Your First Unit Test 10:27 Testing All the Execution Tests 05:22 Refactoring with Confidence 02:14 Using NUnit in Visual Studio 03:59 What is Test-Driven Development 03:19 Course Structure 01:46 Summary 00:41 Asking Questions 00:33 Fundamentals of Unit Testing 13 lectures • 39min Introduction 00:47 Characteristics of Good Unit Tests 02:03 What to Test and What Not to Test 03:00 Naming and Organizing Tests 02:36 Introducing Rider 01:52 Writing a Simple Unit Test 03:52 Black-box Testing 04:43 Set Up and Tear Down 03:36 Parameterized Tests 03:25 Ignoring Tests 01:33 Writing Trustworthy Tests 06:11 Developers Who Don't Write Tests 03:51 Summary 01:33 Core Unit Testing Techniques 11 lectures • 46min Introduction 00:32 Testing Strings 05:50 Testing Arrays and Collections 06:11 Testing the Return Type of Methods 04:02 Testing Void Methods 04:42 Testing Methods that Throw Exceptions 04:10 Testing Methods that Raise an Event 04:34 Testing Private Methods 09:50 Code Coverage 02:30 Testing in the Real-world 02:32 Summary 00:46 Exercises 6 lectures • 34min 19- Exercise- FizzBuzz 01:19 20- Solution- FizzBuzz 06:19 Exercise- DemeritPointsCalculator 00:54 Solution- DemeritPointsCalculator 09:43 Exercise- Stack 00:49 Solution- Stack 14:55 Breaking External Dependencies 14 lectures • 56min Introduction 02:16 Loosely-coupled and Testable Code 03:34 Refactoring Towards a Loosely-coupled Design 09:42 Dependency Injection via Method Parameters 05:09 Dependency Injection via Properties 02:41 Dependency Injection via Constructor 04:22 Dependency Injection Frameworks 03:26 Mocking Frameworks 01:55 Creating Mock Objects Using Moq 06:47 State-based vs. Interaction Testing 01:54 Testing the Interaction Between Two Objects 03:40 Fake as Little As Possible 03:10 An Example of a Mock Abuse 04:54 Who Should Write Tests 02:01 Exercises 9 lectures • 41min Exercise- VideoService 01:11 Refactoring 05:47 Testing 07:55 Exercise- InstallerHelper 01:26 Refactoring InstallerHelper 04:47 Testing InstallerHelper 08:05 Exercise- EmployeeHelper 02:37 Refactoring EmployeeController 05:24 Testing EmployeeController 04:00 Project- Testing BookingHelper 8 lectures • 36min Introduction 02:12 Test Cases 03:40 Extracting IBooking Repository 07:44 Writing the First Test 04:29 Refactoring 07:50 Writing the Second Test 01:28 Fixing a Bug 03:44 Writing Additional Tests 04:44 Project- HouseKeeperHelper 11 lectures • 54min Introduction 02:07 Refactoring For Testability 09:32 Fixing a Design Issue 02:59 An Alternative Solution 00:38 Writing the First Interaction Test 07:40 Keeping Tests Clean 05:42 Testing a Method is Not Called 05:37 Another Interaction Test 07:31 Extracting Helper Methods 08:02 Testing Exceptions 03:34 Coupons to My Other Courses Preview 00:20 Requirements Minimum 3 months programming in C# Description Picture this: you make a simple change to the code and suddenly realize that you created a dozen unexpected bugs. Sound familiar? You’re not alone! Good news is, unit testing can make this a thing of the past. Maybe you’ve heard of automated or unit testing before and you’re keen to learn more. Or perhaps you’ve tried to learn it and got a bit lost or ended up with fat and fragile tests that got in the way and slowed you down. Either way, what you need is a course that will teach you all you need to know about this essential skill - from the basics, right through to mastery level. What is unit testing? In a nutshell: it’s the practice of writing code to test your code and then run those tests in an automated fashion. Why learn unit testing? Why write extra code? Wouldn’t that take extra time to write? Would that slow you down? Why not just run the application and test it like an end user? Thinking like this is the mistake lots of people make. I used to make it myself. I’ve had to learn the hard way! I learned pretty fast that if you’re building a complex application or working on a legacy app, manually testing all the various functions is tedious and takes a significant amount of time. As your application grows, the cost of manual testing grows exponentially. And you’re never 100% sure if you’ve fully tested all the edge cases. You’re never confident that your code really works until you release your software and get a call from your boss or an end user! Several studies have shown that the later a bug is caught in the software development lifecycle, the more costly it is to the business. Automated tests help you to catch bugs earlier in the software development lifecycle , right when you’re coding. These tests are repeatable. Write them once and run them over and over. The benefits of using unit tests are: help you to catch and fix bugs earlier, before releasing your app into production help you to write better code with less bugs help you to produce software with better design - extensible and loosely-coupled give you rapid feedback and tell you if your code *really* works force you to think of edge cases that you didn’t realize existed test your code much faster tell if you have broken any functionality as you write new code allow you to refactor your code with confidence act as documentation about what your code does save you both time and money A valuable skill for senior developers More and more companies are recognizing the advantages of automated testing, that’s why it’s a must-have for senior coders. If you’re looking to reach the higher levels in your coding career, this course can help. You don’t need any prior knowledge of automated testing. You only need 3 months of experience programming in C#. With this course you’ll learn: senior coder secrets - best practices to write great unit tests tips and tricks to keep your tests clean, trustworthy and maintainable the pitfalls to avoid – anti-patterns how to refactor legacy, untestable code into loosely-coupled and testable code all about dependency injection – the one thing every coder needs to know the power of mocks – when and how to use them and when to avoid You’ll get: 6 hours of HD video tutorials and guidance from a senior coder with 15+ years’ experience exercises with step-by-step solution downloadable source code lifetime access access online or offline at any time on any device certificate of completion to present to your current or prospective employer Who this course is for: Anyone who wants to build better quality software with fewer bugs Any developers who want to transition to the senior level Show more Show less Featured review Razique 25 courses 5 reviews Rating: 5.0 out of 5 a year ago This is a great course on unit testing. The theory is there, so the hands-on. A lot of coding, and chances to practices the skills learned. I took this one right after the advanced course, and I have to say that I still needed to wrap my head around certain things. What I like about Mosh, as usual, is his passion and experience. That shows in how clean and efficient the code is. Thank you so much for creating such an amazing course. Show more Show less Instructor Mosh Hamedani Passionate Software Engineer and Best-selling Author 4.5 Instructor Rating 224,418 Reviews 536,711 Students 20 Courses Hi! My name is Mosh (Moshfegh) Hamedani! I'm a passionate software engineer with two decades of experience and I've taught over 3 million people who to code or how to become professional software engineers through my YouTube channel and online courses. My goal is to make software engineering fun and accessible to everyone. That's why my courses are simple, pragmatic and free of BS. Show more Show less Udemy Business Teach on Udemy Get the app About us Contact us Careers Blog Help and Support Affiliate Impressum Kontakt Terms Privacy policy Cookie settings Sitemap © 2021 Udemy, Inc. window.handleCSSToggleButtonClick = function (event) { var target = event.currentTarget; var cssToggleId = target && target.dataset && target.dataset.cssToggleId; var input = cssToggleId && document.getElementById(cssToggleId); if (input) { if (input.dataset.type === 'checkbox') { input.dataset.checked = input.dataset.checked ? '' : 'checked'; } else { input.dataset.checked = input.dataset.allowToggle && input.dataset.checked ? '' : 'checked'; var radios = document.querySelectorAll('[name="' + input.dataset.name + '"]'); for (var i = 0; i (function(){window['__CF$cv$params']={r:'677700bf2bf153b0',m:'541a2db1a51e0174d70337e8a16c19d0b292ffc0-1627736356-1800-AZ2Ma3E4XK8D+co2uKsfVrHndVD27jAVsNnwVy62KNkjvBQmLkhDcG2AUiLbdXnZ86O20IXlrKmR8/cwXly3+K/qkgQamuHDijkGWeoxj5la1nPe2HpKZp7n35zYlQ6C6oL2vpL0idVDegfuKN1IAEs=',s:[0x9243c1295c,0x81360ad2ed],}})();
  5. Understand and implement dependency injection Use mocks to isolate code from external dependencies Apply the unit testing best practices Learn the anti-patterns to avoid Curated for the Udemy Business collection Course content 8 sections • 86 lectures • 5h 48m total length Expand all sections Getting Started 14 lectures • 44min What is Automated Testing Preview 02:40 Benefits of Automated Testing Preview 02:37 Types of Tests Preview 04:00 Test Pyramid Preview 02:55 The Tooling 02:52 Source Code 00:15 Writing Your First Unit Test 10:27 Testing All the Execution Tests 05:22 Refactoring with Confidence 02:14 Using NUnit in Visual Studio 03:59 What is Test-Driven Development 03:19 Course Structure 01:46 Summary 00:41 Asking Questions 00:33 Fundamentals of Unit Testing 13 lectures • 39min Introduction 00:47 Characteristics of Good Unit Tests 02:03 What to Test and What Not to Test 03:00 Naming and Organizing Tests 02:36 Introducing Rider 01:52 Writing a Simple Unit Test 03:52 Black-box Testing 04:43 Set Up and Tear Down 03:36 Parameterized Tests 03:25 Ignoring Tests 01:33 Writing Trustworthy Tests 06:11 Developers Who Don't Write Tests 03:51 Summary 01:33 Core Unit Testing Techniques 11 lectures • 46min Introduction 00:32 Testing Strings 05:50 Testing Arrays and Collections 06:11 Testing the Return Type of Methods 04:02 Testing Void Methods 04:42 Testing Methods that Throw Exceptions 04:10 Testing Methods that Raise an Event 04:34 Testing Private Methods 09:50 Code Coverage 02:30 Testing in the Real-world 02:32 Summary 00:46 Exercises 6 lectures • 34min 19- Exercise- FizzBuzz 01:19 20- Solution- FizzBuzz 06:19 Exercise- DemeritPointsCalculator 00:54 Solution- DemeritPointsCalculator 09:43 Exercise- Stack 00:49 Solution- Stack 14:55 Breaking External Dependencies 14 lectures • 56min Introduction 02:16 Loosely-coupled and Testable Code 03:34 Refactoring Towards a Loosely-coupled Design 09:42 Dependency Injection via Method Parameters 05:09 Dependency Injection via Properties 02:41 Dependency Injection via Constructor 04:22 Dependency Injection Frameworks 03:26 Mocking Frameworks 01:55 Creating Mock Objects Using Moq 06:47 State-based vs. Interaction Testing 01:54 Testing the Interaction Between Two Objects 03:40 Fake as Little As Possible 03:10 An Example of a Mock Abuse 04:54 Who Should Write Tests 02:01 Exercises 9 lectures • 41min Exercise- VideoService 01:11 Refactoring 05:47 Testing 07:55 Exercise- InstallerHelper 01:26 Refactoring InstallerHelper 04:47 Testing InstallerHelper 08:05 Exercise- EmployeeHelper 02:37 Refactoring EmployeeController 05:24 Testing EmployeeController 04:00 Project- Testing BookingHelper 8 lectures • 36min Introduction 02:12 Test Cases 03:40 Extracting IBooking Repository 07:44 Writing the First Test 04:29 Refactoring 07:50 Writing the Second Test 01:28 Fixing a Bug 03:44 Writing Additional Tests 04:44 Project- HouseKeeperHelper 11 lectures • 54min Introduction 02:07 Refactoring For Testability 09:32 Fixing a Design Issue 02:59 An Alternative Solution 00:38 Writing the First Interaction Test 07:40 Keeping Tests Clean 05:42 Testing a Method is Not Called 05:37 Another Interaction Test 07:31 Extracting Helper Methods 08:02 Testing Exceptions 03:34 Coupons to My Other Courses Preview 00:20 Requirements Minimum 3 months programming in C# Description Picture this: you make a simple change to the code and suddenly realize that you created a dozen unexpected bugs. Sound familiar? You’re not alone! Good news is, unit testing can make this a thing of the past. Maybe you’ve heard of automated or unit testing before and you’re keen to learn more. Or perhaps you’ve tried to learn it and got a bit lost or ended up with fat and fragile tests that got in the way and slowed you down. Either way, what you need is a course that will teach you all you need to know about this essential skill - from the basics, right through to mastery level. What is unit testing? In a nutshell: it’s the practice of writing code to test your code and then run those tests in an automated fashion. Why learn unit testing? Why write extra code? Wouldn’t that take extra time to write? Would that slow you down? Why not just run the application and test it like an end user? Thinking like this is the mistake lots of people make. I used to make it myself. I’ve had to learn the hard way! I learned pretty fast that if you’re building a complex application or working on a legacy app, manually testing all the various functions is tedious and takes a significant amount of time. As your application grows, the cost of manual testing grows exponentially. And you’re never 100% sure if you’ve fully tested all the edge cases. You’re never confident that your code really works until you release your software and get a call from your boss or an end user! Several studies have shown that the later a bug is caught in the software development lifecycle, the more costly it is to the business. Automated tests help you to catch bugs earlier in the software development lifecycle , right when you’re coding. These tests are repeatable. Write them once and run them over and over. The benefits of using unit tests are: help you to catch and fix bugs earlier, before releasing your app into production help you to write better code with less bugs help you to produce software with better design - extensible and loosely-coupled give you rapid feedback and tell you if your code *really* works force you to think of edge cases that you didn’t realize existed test your code much faster tell if you have broken any functionality as you write new code allow you to refactor your code with confidence act as documentation about what your code does save you both time and money A valuable skill for senior developers More and more companies are recognizing the advantages of automated testing, that’s why it’s a must-have for senior coders. If you’re looking to reach the higher levels in your coding career, this course can help. You don’t need any prior knowledge of automated testing. You only need 3 months of experience programming in C#. With this course you’ll learn: senior coder secrets - best practices to write great unit tests tips and tricks to keep your tests clean, trustworthy and maintainable the pitfalls to avoid – anti-patterns how to refactor legacy, untestable code into loosely-coupled and testable code all about dependency injection – the one thing every coder needs to know the power of mocks – when and how to use them and when to avoid You’ll get: 6 hours of HD video tutorials and guidance from a senior coder with 15+ years’ experience exercises with step-by-step solution downloadable source code lifetime access access online or offline at any time on any device certificate of completion to present to your current or prospective employer Who this course is for: Anyone who wants to build better quality software with fewer bugs Any developers who want to transition to the senior level Show more Show less Featured review Razique 25 courses 5 reviews Rating: 5.0 out of 5 a year ago This is a great course on unit testing. The theory is there, so the hands-on. A lot of coding, and chances to practices the skills learned. I took this one right after the advanced course, and I have to say that I still needed to wrap my head around certain things. What I like about Mosh, as usual, is his passion and experience. That shows in how clean and efficient the code is. Thank you so much for creating such an amazing course. Show more Show less Instructor Mosh Hamedani Passionate Software Engineer and Best-selling Author 4.5 Instructor Rating 224,418 Reviews 536,711 Students 20 Courses Hi! My name is Mosh (Moshfegh) Hamedani! I'm a passionate software engineer with two decades of experience and I've taught over 3 million people who to code or how to become professional software engineers through my YouTube channel and online courses. My goal is to make software engineering fun and accessible to everyone. That's why my courses are simple, pragmatic and free of BS. Show more Show less Udemy Business Teach on Udemy Get the app About us Contact us Careers Blog Help and Support Affiliate Impressum Kontakt Terms Privacy policy Cookie settings Sitemap © 2021 Udemy, Inc. window.handleCSSToggleButtonClick = function (event) { var target = event.currentTarget; var cssToggleId = target && target.dataset && target.dataset.cssToggleId; var input = cssToggleId && document.getElementById(cssToggleId); if (input) { if (input.dataset.type === 'checkbox') { input.dataset.checked = input.dataset.checked ? '' : 'checked'; } else { input.dataset.checked = input.dataset.allowToggle && input.dataset.checked ? '' : 'checked'; var radios = document.querySelectorAll('[name="' + input.dataset.name + '"]'); for (var i = 0; i (function(){window['__CF$cv$params']={r:'677700bf2bf153b0',m:'541a2db1a51e0174d70337e8a16c19d0b292ffc0-1627736356-1800-AZ2Ma3E4XK8D+co2uKsfVrHndVD27jAVsNnwVy62KNkjvBQmLkhDcG2AUiLbdXnZ86O20IXlrKmR8/cwXly3+K/qkgQamuHDijkGWeoxj5la1nPe2HpKZp7n35zYlQ6C6oL2vpL0idVDegfuKN1IAEs=',s:[0x9243c1295c,0x81360ad2ed],}})();
  6. Use mocks to isolate code from external dependencies Apply the unit testing best practices Learn the anti-patterns to avoid Curated for the Udemy Business collection Course content 8 sections • 86 lectures • 5h 48m total length Expand all sections Getting Started 14 lectures • 44min What is Automated Testing Preview 02:40 Benefits of Automated Testing Preview 02:37 Types of Tests Preview 04:00 Test Pyramid Preview 02:55 The Tooling 02:52 Source Code 00:15 Writing Your First Unit Test 10:27 Testing All the Execution Tests 05:22 Refactoring with Confidence 02:14 Using NUnit in Visual Studio 03:59 What is Test-Driven Development 03:19 Course Structure 01:46 Summary 00:41 Asking Questions 00:33 Fundamentals of Unit Testing 13 lectures • 39min Introduction 00:47 Characteristics of Good Unit Tests 02:03 What to Test and What Not to Test 03:00 Naming and Organizing Tests 02:36 Introducing Rider 01:52 Writing a Simple Unit Test 03:52 Black-box Testing 04:43 Set Up and Tear Down 03:36 Parameterized Tests 03:25 Ignoring Tests 01:33 Writing Trustworthy Tests 06:11 Developers Who Don't Write Tests 03:51 Summary 01:33 Core Unit Testing Techniques 11 lectures • 46min Introduction 00:32 Testing Strings 05:50 Testing Arrays and Collections 06:11 Testing the Return Type of Methods 04:02 Testing Void Methods 04:42 Testing Methods that Throw Exceptions 04:10 Testing Methods that Raise an Event 04:34 Testing Private Methods 09:50 Code Coverage 02:30 Testing in the Real-world 02:32 Summary 00:46 Exercises 6 lectures • 34min 19- Exercise- FizzBuzz 01:19 20- Solution- FizzBuzz 06:19 Exercise- DemeritPointsCalculator 00:54 Solution- DemeritPointsCalculator 09:43 Exercise- Stack 00:49 Solution- Stack 14:55 Breaking External Dependencies 14 lectures • 56min Introduction 02:16 Loosely-coupled and Testable Code 03:34 Refactoring Towards a Loosely-coupled Design 09:42 Dependency Injection via Method Parameters 05:09 Dependency Injection via Properties 02:41 Dependency Injection via Constructor 04:22 Dependency Injection Frameworks 03:26 Mocking Frameworks 01:55 Creating Mock Objects Using Moq 06:47 State-based vs. Interaction Testing 01:54 Testing the Interaction Between Two Objects 03:40 Fake as Little As Possible 03:10 An Example of a Mock Abuse 04:54 Who Should Write Tests 02:01 Exercises 9 lectures • 41min Exercise- VideoService 01:11 Refactoring 05:47 Testing 07:55 Exercise- InstallerHelper 01:26 Refactoring InstallerHelper 04:47 Testing InstallerHelper 08:05 Exercise- EmployeeHelper 02:37 Refactoring EmployeeController 05:24 Testing EmployeeController 04:00 Project- Testing BookingHelper 8 lectures • 36min Introduction 02:12 Test Cases 03:40 Extracting IBooking Repository 07:44 Writing the First Test 04:29 Refactoring 07:50 Writing the Second Test 01:28 Fixing a Bug 03:44 Writing Additional Tests 04:44 Project- HouseKeeperHelper 11 lectures • 54min Introduction 02:07 Refactoring For Testability 09:32 Fixing a Design Issue 02:59 An Alternative Solution 00:38 Writing the First Interaction Test 07:40 Keeping Tests Clean 05:42 Testing a Method is Not Called 05:37 Another Interaction Test 07:31 Extracting Helper Methods 08:02 Testing Exceptions 03:34 Coupons to My Other Courses Preview 00:20 Requirements Minimum 3 months programming in C# Description Picture this: you make a simple change to the code and suddenly realize that you created a dozen unexpected bugs. Sound familiar? You’re not alone! Good news is, unit testing can make this a thing of the past. Maybe you’ve heard of automated or unit testing before and you’re keen to learn more. Or perhaps you’ve tried to learn it and got a bit lost or ended up with fat and fragile tests that got in the way and slowed you down. Either way, what you need is a course that will teach you all you need to know about this essential skill - from the basics, right through to mastery level. What is unit testing? In a nutshell: it’s the practice of writing code to test your code and then run those tests in an automated fashion. Why learn unit testing? Why write extra code? Wouldn’t that take extra time to write? Would that slow you down? Why not just run the application and test it like an end user? Thinking like this is the mistake lots of people make. I used to make it myself. I’ve had to learn the hard way! I learned pretty fast that if you’re building a complex application or working on a legacy app, manually testing all the various functions is tedious and takes a significant amount of time. As your application grows, the cost of manual testing grows exponentially. And you’re never 100% sure if you’ve fully tested all the edge cases. You’re never confident that your code really works until you release your software and get a call from your boss or an end user! Several studies have shown that the later a bug is caught in the software development lifecycle, the more costly it is to the business. Automated tests help you to catch bugs earlier in the software development lifecycle , right when you’re coding. These tests are repeatable. Write them once and run them over and over. The benefits of using unit tests are: help you to catch and fix bugs earlier, before releasing your app into production help you to write better code with less bugs help you to produce software with better design - extensible and loosely-coupled give you rapid feedback and tell you if your code *really* works force you to think of edge cases that you didn’t realize existed test your code much faster tell if you have broken any functionality as you write new code allow you to refactor your code with confidence act as documentation about what your code does save you both time and money A valuable skill for senior developers More and more companies are recognizing the advantages of automated testing, that’s why it’s a must-have for senior coders. If you’re looking to reach the higher levels in your coding career, this course can help. You don’t need any prior knowledge of automated testing. You only need 3 months of experience programming in C#. With this course you’ll learn: senior coder secrets - best practices to write great unit tests tips and tricks to keep your tests clean, trustworthy and maintainable the pitfalls to avoid – anti-patterns how to refactor legacy, untestable code into loosely-coupled and testable code all about dependency injection – the one thing every coder needs to know the power of mocks – when and how to use them and when to avoid You’ll get: 6 hours of HD video tutorials and guidance from a senior coder with 15+ years’ experience exercises with step-by-step solution downloadable source code lifetime access access online or offline at any time on any device certificate of completion to present to your current or prospective employer Who this course is for: Anyone who wants to build better quality software with fewer bugs Any developers who want to transition to the senior level Show more Show less Featured review Razique 25 courses 5 reviews Rating: 5.0 out of 5 a year ago This is a great course on unit testing. The theory is there, so the hands-on. A lot of coding, and chances to practices the skills learned. I took this one right after the advanced course, and I have to say that I still needed to wrap my head around certain things. What I like about Mosh, as usual, is his passion and experience. That shows in how clean and efficient the code is. Thank you so much for creating such an amazing course. Show more Show less Instructor Mosh Hamedani Passionate Software Engineer and Best-selling Author 4.5 Instructor Rating 224,418 Reviews 536,711 Students 20 Courses Hi! My name is Mosh (Moshfegh) Hamedani! I'm a passionate software engineer with two decades of experience and I've taught over 3 million people who to code or how to become professional software engineers through my YouTube channel and online courses. My goal is to make software engineering fun and accessible to everyone. That's why my courses are simple, pragmatic and free of BS. Show more Show less Udemy Business Teach on Udemy Get the app About us Contact us Careers Blog Help and Support Affiliate Impressum Kontakt Terms Privacy policy Cookie settings Sitemap © 2021 Udemy, Inc. window.handleCSSToggleButtonClick = function (event) { var target = event.currentTarget; var cssToggleId = target && target.dataset && target.dataset.cssToggleId; var input = cssToggleId && document.getElementById(cssToggleId); if (input) { if (input.dataset.type === 'checkbox') { input.dataset.checked = input.dataset.checked ? '' : 'checked'; } else { input.dataset.checked = input.dataset.allowToggle && input.dataset.checked ? '' : 'checked'; var radios = document.querySelectorAll('[name="' + input.dataset.name + '"]'); for (var i = 0; i (function(){window['__CF$cv$params']={r:'677700bf2bf153b0',m:'541a2db1a51e0174d70337e8a16c19d0b292ffc0-1627736356-1800-AZ2Ma3E4XK8D+co2uKsfVrHndVD27jAVsNnwVy62KNkjvBQmLkhDcG2AUiLbdXnZ86O20IXlrKmR8/cwXly3+K/qkgQamuHDijkGWeoxj5la1nPe2HpKZp7n35zYlQ6C6oL2vpL0idVDegfuKN1IAEs=',s:[0x9243c1295c,0x81360ad2ed],}})();
  7. Apply the unit testing best practices Learn the anti-patterns to avoid Curated for the Udemy Business collection Course content 8 sections • 86 lectures • 5h 48m total length Expand all sections Getting Started 14 lectures • 44min What is Automated Testing Preview 02:40 Benefits of Automated Testing Preview 02:37 Types of Tests Preview 04:00 Test Pyramid Preview 02:55 The Tooling 02:52 Source Code 00:15 Writing Your First Unit Test 10:27 Testing All the Execution Tests 05:22 Refactoring with Confidence 02:14 Using NUnit in Visual Studio 03:59 What is Test-Driven Development 03:19 Course Structure 01:46 Summary 00:41 Asking Questions 00:33 Fundamentals of Unit Testing 13 lectures • 39min Introduction 00:47 Characteristics of Good Unit Tests 02:03 What to Test and What Not to Test 03:00 Naming and Organizing Tests 02:36 Introducing Rider 01:52 Writing a Simple Unit Test 03:52 Black-box Testing 04:43 Set Up and Tear Down 03:36 Parameterized Tests 03:25 Ignoring Tests 01:33 Writing Trustworthy Tests 06:11 Developers Who Don't Write Tests 03:51 Summary 01:33 Core Unit Testing Techniques 11 lectures • 46min Introduction 00:32 Testing Strings 05:50 Testing Arrays and Collections 06:11 Testing the Return Type of Methods 04:02 Testing Void Methods 04:42 Testing Methods that Throw Exceptions 04:10 Testing Methods that Raise an Event 04:34 Testing Private Methods 09:50 Code Coverage 02:30 Testing in the Real-world 02:32 Summary 00:46 Exercises 6 lectures • 34min 19- Exercise- FizzBuzz 01:19 20- Solution- FizzBuzz 06:19 Exercise- DemeritPointsCalculator 00:54 Solution- DemeritPointsCalculator 09:43 Exercise- Stack 00:49 Solution- Stack 14:55 Breaking External Dependencies 14 lectures • 56min Introduction 02:16 Loosely-coupled and Testable Code 03:34 Refactoring Towards a Loosely-coupled Design 09:42 Dependency Injection via Method Parameters 05:09 Dependency Injection via Properties 02:41 Dependency Injection via Constructor 04:22 Dependency Injection Frameworks 03:26 Mocking Frameworks 01:55 Creating Mock Objects Using Moq 06:47 State-based vs. Interaction Testing 01:54 Testing the Interaction Between Two Objects 03:40 Fake as Little As Possible 03:10 An Example of a Mock Abuse 04:54 Who Should Write Tests 02:01 Exercises 9 lectures • 41min Exercise- VideoService 01:11 Refactoring 05:47 Testing 07:55 Exercise- InstallerHelper 01:26 Refactoring InstallerHelper 04:47 Testing InstallerHelper 08:05 Exercise- EmployeeHelper 02:37 Refactoring EmployeeController 05:24 Testing EmployeeController 04:00 Project- Testing BookingHelper 8 lectures • 36min Introduction 02:12 Test Cases 03:40 Extracting IBooking Repository 07:44 Writing the First Test 04:29 Refactoring 07:50 Writing the Second Test 01:28 Fixing a Bug 03:44 Writing Additional Tests 04:44 Project- HouseKeeperHelper 11 lectures • 54min Introduction 02:07 Refactoring For Testability 09:32 Fixing a Design Issue 02:59 An Alternative Solution 00:38 Writing the First Interaction Test 07:40 Keeping Tests Clean 05:42 Testing a Method is Not Called 05:37 Another Interaction Test 07:31 Extracting Helper Methods 08:02 Testing Exceptions 03:34 Coupons to My Other Courses Preview 00:20 Requirements Minimum 3 months programming in C# Description Picture this: you make a simple change to the code and suddenly realize that you created a dozen unexpected bugs. Sound familiar? You’re not alone! Good news is, unit testing can make this a thing of the past. Maybe you’ve heard of automated or unit testing before and you’re keen to learn more. Or perhaps you’ve tried to learn it and got a bit lost or ended up with fat and fragile tests that got in the way and slowed you down. Either way, what you need is a course that will teach you all you need to know about this essential skill - from the basics, right through to mastery level. What is unit testing? In a nutshell: it’s the practice of writing code to test your code and then run those tests in an automated fashion. Why learn unit testing? Why write extra code? Wouldn’t that take extra time to write? Would that slow you down? Why not just run the application and test it like an end user? Thinking like this is the mistake lots of people make. I used to make it myself. I’ve had to learn the hard way! I learned pretty fast that if you’re building a complex application or working on a legacy app, manually testing all the various functions is tedious and takes a significant amount of time. As your application grows, the cost of manual testing grows exponentially. And you’re never 100% sure if you’ve fully tested all the edge cases. You’re never confident that your code really works until you release your software and get a call from your boss or an end user! Several studies have shown that the later a bug is caught in the software development lifecycle, the more costly it is to the business. Automated tests help you to catch bugs earlier in the software development lifecycle , right when you’re coding. These tests are repeatable. Write them once and run them over and over. The benefits of using unit tests are: help you to catch and fix bugs earlier, before releasing your app into production help you to write better code with less bugs help you to produce software with better design - extensible and loosely-coupled give you rapid feedback and tell you if your code *really* works force you to think of edge cases that you didn’t realize existed test your code much faster tell if you have broken any functionality as you write new code allow you to refactor your code with confidence act as documentation about what your code does save you both time and money A valuable skill for senior developers More and more companies are recognizing the advantages of automated testing, that’s why it’s a must-have for senior coders. If you’re looking to reach the higher levels in your coding career, this course can help. You don’t need any prior knowledge of automated testing. You only need 3 months of experience programming in C#. With this course you’ll learn: senior coder secrets - best practices to write great unit tests tips and tricks to keep your tests clean, trustworthy and maintainable the pitfalls to avoid – anti-patterns how to refactor legacy, untestable code into loosely-coupled and testable code all about dependency injection – the one thing every coder needs to know the power of mocks – when and how to use them and when to avoid You’ll get: 6 hours of HD video tutorials and guidance from a senior coder with 15+ years’ experience exercises with step-by-step solution downloadable source code lifetime access access online or offline at any time on any device certificate of completion to present to your current or prospective employer Who this course is for: Anyone who wants to build better quality software with fewer bugs Any developers who want to transition to the senior level Show more Show less Featured review Razique 25 courses 5 reviews Rating: 5.0 out of 5 a year ago This is a great course on unit testing. The theory is there, so the hands-on. A lot of coding, and chances to practices the skills learned. I took this one right after the advanced course, and I have to say that I still needed to wrap my head around certain things. What I like about Mosh, as usual, is his passion and experience. That shows in how clean and efficient the code is. Thank you so much for creating such an amazing course. Show more Show less Instructor Mosh Hamedani Passionate Software Engineer and Best-selling Author 4.5 Instructor Rating 224,418 Reviews 536,711 Students 20 Courses Hi! My