---
title: "Discussion on \"3 ways to check the object passed to mocks with Moq in C#\" | Hashnode"
description: "Discussion on \"3 ways to check the object passed to mocks with Moq in C#\". In unit tests, sometimes you need to perform deep checks on the object passed to the mocked service."
url: "https://hashnode.com/posts/3-ways-to-check-the-object-passed-to-mocks-with-moq-in-csharp/62c7df2f353b847f29e8aec4"
---

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

Discussion

# [3 ways to check the object passed to mocks with Moq in C#](https://code4it.hashnode.dev/3-ways-to-check-the-object-passed-to-mocks-with-moq-in-csharp?utm_source=hashnode&utm_medium=feed)

In unit tests, sometimes you need to perform deep checks on the object passed to the mocked service.

Jul 8, 2022 · 5 min read · code4it.hashnode.dev  
Updated Jul 13, 2022  
Read the article

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

## Written by

[Davide Bellone](https://hashnode.com/@davidebellone)

@davidebellone · Turin, Italy

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

Principal backend developer | Content Creator | Microsoft MVP

I’m a Principal Backend Developer with more than 10 years of professional experience. I’ve been working with Microsoft platforms and frameworks since 2014. I’ve worked with many tools and frameworks, such as Azure, MongoDB, Docker, and, of course, .NET and C#. I love learning new things, and I think that the best way to learn is to share: that’s why I started my journey as a content creator and conference speaker.

## Responses 1

Markdown supported · ⌘↵ to post

[Davide Bellone](https://hashnode.com/@davidebellone)

[Jul 13, 2022](https://hashnode.com/posts/3-ways-to-check-the-object-passed-to-mocks-with-moq-in-csharp/62c7df2f353b847f29e8aec4/comment/62ce9552c88cd0d5ff700f89)

Special thanks to [Moke](https://twitter.com/moke_dev/status/1547150790837604352) who found an error in the last example.
