---
title: "Discussion on \"Injecting AutoMapper profiles in tests\" | Hashnode"
description: "Discussion on \"Injecting AutoMapper profiles in tests\". In the newer services at my client, AutoMapper is used to map DTO's to database objects and back. Because mocking a mapping isn't obvious, a lot of behaviour wasn't tested and that's unacceptable. Let's find out how to properly inject an IMapper with..."
url: "https://hashnode.com/posts/injecting-automapper-profiles-in-tests/6067465843f771326691420f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Injecting AutoMapper profiles in tests](https://kenbonny.net/injecting-automapper-profiles-in-tests?utm_source=hashnode&utm_medium=feed)

In the newer services at my client, AutoMapper is used to map DTO's to database objects and back. Because mocking a mapping isn't obvious, a lot of behaviour wasn't tested and that's unacceptable. Let's find out how to properly inject an IMapper with...

Jan 15, 2018 · 2 min read · kenbonny.net  
Updated Apr 8, 2021  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)
-   [#dotnet](https://hashnode.com/tag/dotnet)
-   [#dotnetcore](https://hashnode.com/tag/dotnetcore)
-   [#unit-testing](https://hashnode.com/tag/unit-testing)
-   [#testing](https://hashnode.com/tag/testing)

## Written by

[Ken Bonny](https://hashnode.com/@KenBonny)

@KenBonny

  
[View profile](https://hashnode.com/@KenBonny)

Software craftsman specialising in Microsoft technology

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
