YUNOVA · C#

Module 13: Professional practice

Notes for offline study · 30 November 2026

Unit testing with xUnit

Key points

  • xUnit marks tests with [Fact] and data-driven tests with [Theory].
  • Assert methods check results, such as Assert.Equal.
  • Each test gets a new class instance, so tests stay isolated.

Dependency injection in .NET

Key points

  • DI passes dependencies in through constructors instead of creating them.
  • Services are registered as transient, scoped or singleton.
  • The built-in container resolves registered services automatically.

SOLID principles in C#

Key points

  • SOLID is five design principles for maintainable classes.
  • Single responsibility: a class should have one reason to change.
  • Depend on abstractions such as interfaces, not concrete classes.

Design patterns in C#

Key points

  • Design patterns are reusable solutions to common design problems.
  • Creational patterns include Factory and Singleton.
  • Strategy and Observer are common behavioural patterns.

Free on YUNOVA · yunova.in · Sign in to add your own lesson notes to this sheet.