AutoFıxture

and writing happy unit tests

Çağrı Özer

Senior Software Developer @Hürriyet

 

  • Maintainability
  • Less bugs
  • Code quality
  • Reduced cost of change
  • Self documentation

Unit testing, but why?

A great Unit test,

  • Fails only when a bug has been introduced
  • Fails fast, for instant feedback
  • Gives comprehensive but easy to understand feedback
  • Is its own documentation

anatomy of unıt tests

  • Arrange
  • Act
  • Assert

Autofixture

by Mark Seemann & community

https://github.com/AutoFixture/AutoFixture

AutoFixture is an open source library for .NET designed to minimize the 'Arrange' phase of your unit tests in order to maximize maintainability. Its primary goal is to allow developers to focus on what is being tested rather than how to setup the test scenario, by making it easier to create object graphs containing test data

Autofixture

  • Flexible architecture
  • Highly customizable
  • Adapter for many mocking frameworks
  • Highlights intent of the test

Talk is Cheap, Show me the code

https://github.com/Rudithus/FunWithAutofixture

Bye

Made with Slides.com