<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Moq - Tag - My Notes</title><link>https://blog.emecas.net/tags/moq/</link><description>Moq - Tag - My Notes</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 23 Feb 2019 12:28:29 -0500</lastBuildDate><atom:link href="https://blog.emecas.net/tags/moq/" rel="self" type="application/rss+xml"/><item><title>Creating Mock Objects for C# Unit Tests, using Moq</title><link>https://blog.emecas.net/posts/2019-02-23-creating-mock-objects-for-c-unit-tests-using-moq/</link><pubDate>Sat, 23 Feb 2019 12:28:29 -0500</pubDate><author>emecas</author><guid>https://blog.emecas.net/posts/2019-02-23-creating-mock-objects-for-c-unit-tests-using-moq/</guid><description><![CDATA[<p>Creating Mock Objects for C# Unit Tests, using Moq<br>
<a href="https://scottlilly.com/creating-mock-objects-for-c-unit-tests-using-moq/" target="_blank" rel="noopener noreffer ">https://scottlilly.com/creating-mock-objects-for-c-unit-tests-using-moq/</a><br>
In my demonstration of the Dependency Injection design pattern, I manually created a mock object. This let me perform unit tests without needing to access a database.<br>
Here is how you can use the Moq library, to eliminate writing the code for manual mock classes.<br>
If you aren’t familiar with dependency injection, please read this article first</p>
<hr>
<p><em>Source: commit <a href="https://github.com/emecas/My-Notes/commit/d0b85b772384455b2bc1f660181a59fa56e782f9" target="_blank" rel="noopener noreffer "><code>d0b85b7</code></a> in My-Notes.</em></p>]]></description></item></channel></rss>