Skip to content

Unit Test Study Notes

These notes are taken while studying Building a Pragmatic Unit Test Suite | Pluralsight and Testing .NET Code with xUnit.net 2: Getting Started | Pluralsight

Unit Test:

  • Verifies small piece of code
  • Runs quickly
  • Runs in isolation

Goals of Unit Test

  • Confidence: Changes don’t break existing functionality
  • Move with a faster pace
  • Maintain low amount of technical debt

Decouple tests from implementation details as much as possible

Styles o Unit Testing

  • Output verification
  • State verification
  • Collaboration verification

Hexagonal Architecture

  • Domain model doesn’t communicate with the outside world, shouldn’t know how is persisted to the DB
  • Application services handle all communications, they don’t contain business lgoic. They Translate between the doman and outside world

Logical Phases of Automated Test

  1. Arrange: Setting things up, create object instances, create data and inputs
  2. Act: Execute production code, call methods, set properties
  3. Assert: Check result

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.