Udemy
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Development
Web Development Data Science Mobile Development Programming Languages Game Development Database Design & Development Software Testing Software Engineering Development Tools No-Code Development
Business
Entrepreneurship Communications Management Sales Business Strategy Operations Project Management Business Law Business Analytics & Intelligence Human Resources Industry E-Commerce Media Real Estate Other Business
Finance & Accounting
Accounting & Bookkeeping Compliance Cryptocurrency & Blockchain Economics Finance Finance Cert & Exam Prep Financial Modeling & Analysis Investing & Trading Money Management Tools Taxes Other Finance & Accounting
IT & Software
IT Certification Network & Security Hardware Operating Systems Other IT & Software
Office Productivity
Microsoft Apple Google SAP Oracle Other Office Productivity
Personal Development
Personal Transformation Personal Productivity Leadership Career Development Parenting & Relationships Happiness Esoteric Practices Religion & Spirituality Personal Brand Building Creativity Influence Self Esteem & Confidence Stress Management Memory & Study Skills Motivation Other Personal Development
Design
Web Design Graphic Design & Illustration Design Tools User Experience Design Game Design Design Thinking 3D & Animation Fashion Design Architectural Design Interior Design Other Design
Marketing
Digital Marketing Search Engine Optimization Social Media Marketing Branding Marketing Fundamentals Marketing Analytics & Automation Public Relations Advertising Video & Mobile Marketing Content Marketing Growth Hacking Affiliate Marketing Product Marketing Other Marketing
Lifestyle
Arts & Crafts Beauty & Makeup Esoteric Practices Food & Beverage Gaming Home Improvement Pet Care & Training Travel Other Lifestyle
Photography & Video
Digital Photography Photography Portrait Photography Photography Tools Commercial Photography Video Design Other Photography & Video
Health & Fitness
Fitness General Health Sports Nutrition Yoga Mental Health Dieting Self Defense Safety & First Aid Dance Meditation Other Health & Fitness
Music
Instruments Music Production Music Fundamentals Vocal Music Techniques Music Software Other Music
Teaching & Academics
Engineering Humanities Math Science Online Education Social Science Language Teacher Training Test Prep Other Teaching & Academics
AWS Certification Microsoft Certification AWS Certified Solutions Architect - Associate AWS Certified Cloud Practitioner CompTIA A+ Cisco CCNA Amazon AWS AWS Certified Developer - Associate CompTIA Security+
Photoshop Graphic Design Adobe Illustrator Drawing Digital Painting InDesign Character Design Canva Figure Drawing
Life Coach Training Neuro-Linguistic Programming Mindfulness Personal Development Personal Transformation Meditation Life Purpose Coaching Neuroscience
Web Development JavaScript React CSS Angular PHP WordPress Node.Js Python
Google Flutter Android Development iOS Development Swift React Native Dart Programming Language Mobile Development Kotlin SwiftUI
Digital Marketing Google Ads (Adwords) Social Media Marketing Google Ads (AdWords) Certification Marketing Strategy Internet Marketing YouTube Marketing Email Marketing Retargeting
SQL Microsoft Power BI Tableau Business Analysis Business Intelligence MySQL Data Analysis Data Modeling Big Data
Business Fundamentals Entrepreneurship Fundamentals Business Strategy Online Business Business Plan Startup Freelancing Blogging Home Business
Unity Game Development Fundamentals Unreal Engine C# 3D Game Development C++ 2D Game Development Unreal Engine Blueprints Blender
30-Day Money-Back Guarantee

This course includes:

  • 7.5 hours on-demand video
  • 6 articles
  • Full lifetime access
  • Access on mobile and TV
Development Software Engineering C#

Learn Unit Testing with NUnit and C#

Learn unit testing, TDD, mocking and Dependency Injection: techniques that you'll need to build reliable software.
Rating: 4.2 out of 54.2 (462 ratings)
3,242 students
Created by Engineer Spock
Last updated 7/2020
English
English [Auto]
30-Day Money-Back Guarantee

What you'll learn

  • Write Unit Tests
  • Run and Debug Unit Tests
  • Write Manual Mocks
  • Write Mocks with Mocking Framework
  • Practice Test-Driven Development (TDD)
  • Apply Best Practices of Writing Unit Tests
Curated for the Udemy for Business collection

Course content

8 sections • 94 lectures • 7h 38m total length

  • How to Ask Questions
    00:23
  • Download Source Code and Slides
    00:03
  • English Subtitles
    00:06
  • Join .NET Community of Students
    00:02

  • Preview00:58
  • Preview03:09
  • Preview03:22
  • Your First Unit Test
    08:49
  • Naming Conventions
    04:34
  • Running and Debugging Unit Tests
    05:02
  • Benefits of Unit Testing
    03:35
  • Who Should Write Unit Tests and When
    02:51
  • Preview03:17
  • Exercise: Degree Converter
    01:29
  • Solution: Degree Converter
    06:54
  • Conclusion
    01:15

  • Outline
    01:01
  • Preview05:29
  • Assert Demo
    10:27
  • Arrange-Act-Assert
    00:58
  • Running Tests from the Console
    01:51
  • SetUp and TearDown
    05:09
  • OneTimeSetUp and OneTimeTearDown
    02:13
  • Parameterized Unit Tests
    03:40
  • Preview02:14
  • Code Coverage
    01:42
  • Exercise: FizzBuzz
    01:07
  • Solution: FizzBuzz
    05:05
  • Exercise: Roman Numerals
    02:27
  • Solution: Roman Numerals
    09:27
  • Exercise: Stack
    00:59
  • Solution: Stack
    09:02
  • Conclusion
    01:38

  • Test Doubles and Dependency Injection
    00:18
  • Outline
    01:09
  • Preview03:43
  • Refactoring to Make Code Testable
    04:19
  • Preview05:55
  • Hand Rolled or Manual Test Doubles
    11:53
  • Problems with Manual Test Doubles
    01:16
  • Mocking Frameworks
    07:52
  • Writing Unit Tests with a Mocking Framework
    07:43
  • NSubstitute Mocking Framework. Key Features. Demo
    18:06
  • Detroit School vs London School of Unit Testing
    02:23
  • Conclusion
    01:18

  • Outline
    00:41
  • What is TDD?
    04:37
  • Red \ Green \ Refactor
    03:38
  • TDD and Design Upfront
    02:35
  • Regular Agile Process in 200 Words
    01:59
  • VS and R# Shortcuts
    03:44
  • Refactoring Commands Built-In VS 2017
    00:09
  • Fibonacci Numbers
    07:38
  • Three Main TDD Techniques
    04:31
  • Grabbing the Gold
    03:10
  • FizzBuzz
    11:06
  • Reading Roman Numerals
    12:07
  • UpdateableSpin
    17:50
  • Continuous Testing
    03:57
  • Tic-Tac-Toe (Crosses and Noughts)
    36:17
  • Assert First
    01:26
  • TDD Demo - Game in Sticks
    32:16
  • Conclusion
    01:38

  • Outline
    00:55
  • Do Unit Tests Guarantee the Success?
    02:25
  • Pragmatic Unit Testing
    05:16
  • Integration Tests
    04:18
  • Singletons and Static Classes
    07:02
  • Header Interfaces
    05:56
  • Demo of Refactoring to a Testable Design
    14:29
  • How Much Test Coverage is Enough?
    02:37
  • Preview02:59
  • The Rule of Testing a Single Concern
    03:06
  • More on Best Practices
    09:52
  • Preview01:25
  • Conclusion
    02:31
  • Final Quiz
    14 questions
  • BONUS LECTURE
    01:18

  • Outline
    01:35
  • Definition of DIP
    03:30
  • Dependencies
    04:49
  • Volatile and Stable Dependencies
    02:53
  • Definition of IoC and DI
    03:19
  • DIP Violation Demo
    02:47
  • Refactoring to a Better Design
    08:31
  • Dependency Injection Techniques
    07:09
  • Architectural Implications
    05:24
  • Common Smells of DIP Violation
    02:37
  • Conclusion
    02:03

  • Outline
    01:07
  • Pure DI and IoC-Containers
    05:01
  • Building a Simple IoC-Container
    03:53
  • Service Locator
    02:54
  • Demo with an IoC-Container
    10:21
  • Conclusion
    01:17

Requirements

  • You should already be familiar with the basics of C#

Description

Learn deeply the concepts and tools that you will need to build maintainable and reliable software.

Teaching Approach

No fluff, no ranting, no beating the air. I respect your time. The course material is succinct, yet comprehensive. All important concepts are covered. Particularly important topics are covered in-depth.

Take this course, and you will be satisfied.   

Build a solid foundation in Unit Testing with this course   

This course is all about writing effective unit tests using C# programming language and NUnit as a unit testing framework. Along the way, we will learn the concepts related to unit testing. Today unit testing is an absolutely required skill from any professional developer. Companies expect from developers to know how to write unit tests including all the most important topics such as mocking and test driven development (TDD in short). This course does not cover all the features of NUnit. This course is way more interesting.   

Learning unit testing puts a powerful and very useful tool at your fingertips. Being familiar with unit testing you can write reliable and maintainable applications. It is very hard to lead a project which is not covered by unit tests.   

Content and Overview   

This course is primarily aimed at beginner developers. It provides solid theoretical base reinforced by tons of practical material.   

We start with basics of unit testing. What is a unit test? What unit testing frameworks exist? How to run and debug unit tests. After getting acquainted with the basics, we will get to the NUnit framework. Here you’ll learn how to install the framework, set the runner. Then you’ll learn the basics of assertions and arrange-act-assert triplet. Other key features of NUnit are also covered:   

  • Running tests from the console   

  • Setup and teardown unit tests   

  • Parameterized tests   

  • Grouping and ignoring   

Practicing writing of unit tests, it’s impossible to avoid applying mocks. I like the word “test double” more, in general. By the way, you’ll learn what the difference between the following notion is:   

  • Test double   

  • Fake   

  • Dummy   

  • Stub   

  • Mock   

You’ll learn how to write test doubles manually. You will also see a simple example of how to use a mocking framework for using mocks. I’ll use NSubstitute mocking framework for demonstration.   

At the end of this section, you’ll get acquainted with two key approaches to unit testing, Classic or Detroit School and London School of unit testing.   

You’ll separately learn the basic of test-driven development. It is hard to imagine a modern professional developer who doesn’t know about TDD, so you’ll learn what it is and what it is about. You’ll see the Red-Green-Refactor triplet in action.   

I could not complete the course avoiding the best practices of writing unit tests. You’ll learn the basic concepts of the modern approach to unit testing called “pragmatic unit testing”. You’ll see what problems static classes and singletons bring regarding the unit testing. They make code harder to unit test. After that, you’ll learn the problem of extracting interfaces just for the sake of introducing shims for injecting dependencies.   

You’ll know should you write unit tests for the trivial code. You’ll learn a lot more in the course.   

So, in short, the course covers the following topics:   

  • Basic notions of Unit Testing   

  • NUnit and its features   

  • Test Doubles including fakes, dummies, stubs, spies and mocks   

  • How to write manual test doubles and how to use a mocking framework  (NSubstitute)

  • TDD, red-green-refactor triplet   

  • A great number of best practices of writing unit tests   

  • Introduction to Dependency Injection

In the end, we will recap what you have learned, and you will try to understand where you have to go further with the intention to master your skills.   

How long is this course: The course is around 7.5 hours. All are video lectures. You will be able to download all the slides and code samples used in the course.         

------------------------------------------------------------

Keywords related to the course:

  • Visual Studio unit testing tutorial

  • NUnit unit testing tutorial

  • Dot Net testing framework

  • C# unit test framework

  • Visual Studio unit testing framework tutorial

  • csharp unit testing tutorial   

  • TDD in C#

  • NSubstitute

  • TDD

  • Test Driven Development

  • unit testing C#

Who this course is for:

  • Beginners who want to write better code
  • Anyone who is interested in Unit Testing

Instructor

Engineer Spock
Software Engineer - 1000+ Reviews, Average Score - 4.5
Engineer Spock
  • 4.2 Instructor Rating
  • 7,516 Reviews
  • 61,458 Students
  • 22 Courses

I'm thankful enough for that I love what I do.

I began my career as a postgraduate student participating in Microsoft ImagineCup contest.

I've been working with .NET platform since 2003. I've been professionally architecting and implementing software for nearly 7 years, primarily based on .NET platform. I'm passionate about building rich and powerful applications using modern technologies. I'm a certified specialist in Windows Applications and Service Communication Applications by Microsoft. I'm one of the coordinators of the MSK.NET User Group in Moscow.

"If it's work, we try to do less. If it's art, we try to do more." - Seth Godin.

What I can say is that software is my art.

  • Udemy for Business
  • Teach on Udemy
  • Get the app
  • About us
  • Contact us
  • Careers
  • Blog
  • Help and Support
  • Affiliate
  • Terms
  • Privacy policy
  • Cookie settings
  • Sitemap
  • Featured courses
Udemy
© 2021 Udemy, Inc.