<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>unit-testing on Alexander Development</title><link>https://alexanderdevelopment.net/tag/unit-testing/</link><description>Recent content in unit-testing on Alexander Development</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 24 Oct 2013 00:00:00 +0000</lastBuildDate><atom:link href="https://alexanderdevelopment.net/tag/unit-testing/index.xml" rel="self" type="application/rss+xml"/><item><title>Unit testing custom Microsoft Dynamics CRM code – Part 7 (web requests)</title><link>https://alexanderdevelopment.net/post/2013/10/24/unit-testing-custom-microsoft-dynamics-crm-code-part-7-web-requests/</link><pubDate>Thu, 24 Oct 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/10/24/unit-testing-custom-microsoft-dynamics-crm-code-part-7-web-requests/</guid><description>One of the main points of all my unit testing posts is that unit tests should be written so that you can test your code without needing to rely on external resources, and, we&amp;rsquo;ve been able to use Moq as a stand-in for Dynamics CRM’s related services without too much trouble.</description></item><item><title>Unit testing custom Microsoft Dynamics CRM code – Part 8 (exception raising)</title><link>https://alexanderdevelopment.net/post/2013/10/24/unit-testing-custom-microsoft-dynamics-crm-code-part-8-exception-raising/</link><pubDate>Thu, 24 Oct 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/10/24/unit-testing-custom-microsoft-dynamics-crm-code-part-8-exception-raising/</guid><description>This is the final post in my series on unit testing custom Microsoft Dynamics CRM code in which I&amp;rsquo;ve been showing how you can unit test custom C# code that interacts with Microsoft Dynamics CRM using Visual Studio&amp;rsquo;s unit testing tools and Moq. We&amp;rsquo;ve looked at several different scenarios thus far, but none of them included the method under test throwing an exception.</description></item><item><title>Unit testing custom Microsoft Dynamics CRM code – Part 6 (plug-ins)</title><link>https://alexanderdevelopment.net/post/2013/10/21/unit-testing-custom-microsoft-dynamics-crm-code-part-6-plug-ins/</link><pubDate>Mon, 21 Oct 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/10/21/unit-testing-custom-microsoft-dynamics-crm-code-part-6-plug-ins/</guid><description>In my last post, I showed how to unit test a Microsoft Dynamics CRM custom workflow activity using Visual Studio and Moq. In this post I will show you how to unit test a Dynamics CRM plug-in. For this example we&amp;rsquo;ll be using the sample FollowupPlugin class in the CRM 2011 SDK, but the principles I will demonstrate are applicable to any plug-in.</description></item><item><title>Unit testing custom Microsoft Dynamics CRM code – Part 5 (custom workflow activities)</title><link>https://alexanderdevelopment.net/post/2013/10/17/unit-testing-custom-microsoft-dynamics-crm-code-part-5/</link><pubDate>Thu, 17 Oct 2013 18:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/10/17/unit-testing-custom-microsoft-dynamics-crm-code-part-5/</guid><description>In the last three posts of this series, I showed how to unit test Microsoft Dynamics CRM C# interfaces code with mock objects using Visual Studio 2012 and Moq. In this post, I will show how to unit test custom workflow activities that are executed by Dynamics CRM processes. I will be using the regular expression validation custom workflow activity I showed in my &amp;ldquo;Using regular expressions in Dynamics CRM 2011 processes&amp;rdquo; post.</description></item><item><title>Unit testing custom Microsoft Dynamics CRM code – Part 4 (using a wrapper class)</title><link>https://alexanderdevelopment.net/post/2013/10/17/unit-testing-custom-microsoft-dynamics-crm-code-part-4/</link><pubDate>Thu, 17 Oct 2013 17:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/10/17/unit-testing-custom-microsoft-dynamics-crm-code-part-4/</guid><description>In parts two and three of this series, I gave an introduction to unit testing Dynamics CRM C# interfaces code with mock objects using Visual Studio 2012 and Moq, and I showed code samples for a couple of different scenarios. In this post I will show how to work with CRM metadata (optionset values, statuscode values, etc.</description></item><item><title>Unit testing custom Microsoft Dynamics CRM code – Part 3 (intermediate interface example)</title><link>https://alexanderdevelopment.net/post/2013/10/10/unit-testing-custom-microsoft-dynamics-crm-code-part-3/</link><pubDate>Thu, 10 Oct 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/10/10/unit-testing-custom-microsoft-dynamics-crm-code-part-3/</guid><description>In my last post I gave an introduction to unit testing Dynamics CRM C# interfaces code with mock objects using Visual Studio 2012 and Moq. The sample code in that post was extremely simple, so I wanted to follow up with a more complex example that shows how to test multiple calls to the CRM web service instead of just a single one.</description></item><item><title>Unit testing custom Microsoft Dynamics CRM code – Part 2 (simple interface example)</title><link>https://alexanderdevelopment.net/post/2013/10/09/unit-testing-custom-microsoft-dynamics-crm-code-part-2/</link><pubDate>Wed, 09 Oct 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/10/09/unit-testing-custom-microsoft-dynamics-crm-code-part-2/</guid><description>In my last post I explained why you should unit test your Dynamics CRM-facing code using frameworks to handle both testing automation and mock objects. In this post, I&amp;rsquo;m going to provide an overview of how to get started.
As I mentioned last time, we&amp;rsquo;ll be using the unit testing tools included in Visual Studio 2012 for the unit testing automation and Moq for the object mocking.</description></item><item><title>Unit testing custom Microsoft Dynamics CRM code – Part 1 (series introduction)</title><link>https://alexanderdevelopment.net/post/2013/10/02/unit-testing-custom-microsoft-dynamics-crm-code-part-1/</link><pubDate>Wed, 02 Oct 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/10/02/unit-testing-custom-microsoft-dynamics-crm-code-part-1/</guid><description>When writing custom code that interacts with Microsoft Dynamics CRM, it is important to:
Unit test your code Use an automated unit testing framework to automate your unit tests Write unit tests that do not depend on external resources such as a Microsoft Dynamics CRM application server or SQL Server Over the course of my next several posts, I&amp;rsquo;ll be showing you some best practices for unit testing Dynamics CRM-facing code using Visual Studio unit testing tools and the Moq object mocking library.</description></item><item><title>Updated "Unit testing Dynamics CRM C# interfaces code using NUnit and Moq" code sample</title><link>https://alexanderdevelopment.net/post/2013/05/01/updated-unit-testing-dynamics-crm-c-interfaces-code-using-nunit-and-moq-code-sample/</link><pubDate>Wed, 01 May 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/05/01/updated-unit-testing-dynamics-crm-c-interfaces-code-using-nunit-and-moq-code-sample/</guid><description>Back in January, after I published my How to unit test C# Dynamics CRM interface code - part III post on how to use NUnit and Moq to test Dynamics CRM interfacing code, I uploaded my project files to the MSDN code gallery. Earlier this week I revisited my original solution while preparing a demo for some of my colleagues.</description></item><item><title>How to unit test C# Dynamics CRM interface code - part III</title><link>https://alexanderdevelopment.net/post/2013/01/13/how-to-unit-test-c-dynamics-crm-interface-code-part-iii/</link><pubDate>Sun, 13 Jan 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/01/13/how-to-unit-test-c-dynamics-crm-interface-code-part-iii/</guid><description>In parts one and two of this series, I gave an introduction to unit testing Dynamics CRM C# interfaces code with mock objects using NUnit and Moq, and I showed code samples for a couple of different scenarios. In this post I will show how to work with CRM metadata (optionset values, statuscode values, etc.</description></item><item><title>How to unit test C# Dynamics CRM interface code - part II</title><link>https://alexanderdevelopment.net/post/2013/01/09/how-to-unit-test-c-dynamics-crm-interface-code-part-ii/</link><pubDate>Wed, 09 Jan 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/01/09/how-to-unit-test-c-dynamics-crm-interface-code-part-ii/</guid><description>Earlier this week I wrote a post that gave an introduction to unit testing Dynamics CRM C# interfaces code with mock objects using NUnit and Moq. The sample code in that post was extremely simple, so I wanted to follow up with a more complex example that shows how to test multiple calls to the CRM web service instead of just a single one.</description></item><item><title>How to unit test C# Dynamics CRM interface code</title><link>https://alexanderdevelopment.net/post/2013/01/06/how-to-unit-test-c-sharp-dynamics-crm-interfaces-code/</link><pubDate>Sun, 06 Jan 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/01/06/how-to-unit-test-c-sharp-dynamics-crm-interfaces-code/</guid><description>A while back I wrote a post that gave a high-level overview of some of the tools I had used at a previous job to do unit testing of Dynamics CRM interfaces code, but I didn&amp;rsquo;t get into the why or how. Here is an introduction to unit testing Dynamics CRM code using an automated unit testing framework and a mock object framework.</description></item><item><title>Unit testing Microsoft Dynamics CRM code</title><link>https://alexanderdevelopment.net/post/2011/04/01/unit-testing-microsoft-dynamics-crm-code/</link><pubDate>Fri, 01 Apr 2011 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2011/04/01/unit-testing-microsoft-dynamics-crm-code/</guid><description>If you&amp;rsquo;re developing code that runs against Dynamics CRM, you know you should be testing it, right? As a developer first and foremost, I always believed that tests and documentation got in the way of the important - and more fun - stuff, but as I transitioned into a management role with responsibility for my company&amp;rsquo;s Dynamics CRM system, I began to appreciate the value of the less-fun stuff.</description></item></channel></rss>