<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Going Further with Fluent Builders in your Tests &#8211; C#	</title>
	<atom:link href="https://www.cognim.co.uk/going-further-with-fluent-builders-in-your-tests-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.cognim.co.uk/going-further-with-fluent-builders-in-your-tests-c/</link>
	<description>Enterprise system implementation. Making the complex simple</description>
	<lastBuildDate>Tue, 15 Sep 2015 11:49:16 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Darren Hall		</title>
		<link>https://www.cognim.co.uk/going-further-with-fluent-builders-in-your-tests-c/#comment-145</link>

		<dc:creator><![CDATA[Darren Hall]]></dc:creator>
		<pubDate>Tue, 15 Sep 2015 11:49:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.cognim.co.uk/?p=5231#comment-145</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.cognim.co.uk/going-further-with-fluent-builders-in-your-tests-c/#comment-114&quot;&gt;Weq&lt;/a&gt;.

Thanks for your comment Weq.
&lt;a href=&quot;http://nsubstitute.github.io/help/getting-started/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;NSubstitute&lt;/a&gt;, &lt;a href=&quot;https://github.com/AutoFixture/AutoFixture&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;AutoFixture&lt;/a&gt; and &lt;a href=&quot;http://www.fluentassertions.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;FluentAssertions&lt;/a&gt; are all excellent tools - especially FluentAssertions which I will be writing a blog about soon. I used Moq here as it is generally well known and I didn&#039;t want to confuse or detract from the main article.

I would usually use bespoke builders over autofixture though as I find them more specific and they allow me to quickly (and legibly) create expected classes for comparison against returned classes in a test.  I use FluentAssertions to make the comparison.

Darren]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.cognim.co.uk/going-further-with-fluent-builders-in-your-tests-c/#comment-114">Weq</a>.</p>
<p>Thanks for your comment Weq.<br />
<a href="http://nsubstitute.github.io/help/getting-started/" target="_blank" rel="nofollow">NSubstitute</a>, <a href="https://github.com/AutoFixture/AutoFixture" target="_blank" rel="nofollow">AutoFixture</a> and <a href="http://www.fluentassertions.com/" target="_blank" rel="nofollow">FluentAssertions</a> are all excellent tools &#8211; especially FluentAssertions which I will be writing a blog about soon. I used Moq here as it is generally well known and I didn&#8217;t want to confuse or detract from the main article.</p>
<p>I would usually use bespoke builders over autofixture though as I find them more specific and they allow me to quickly (and legibly) create expected classes for comparison against returned classes in a test.  I use FluentAssertions to make the comparison.</p>
<p>Darren</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Weq		</title>
		<link>https://www.cognim.co.uk/going-further-with-fluent-builders-in-your-tests-c/#comment-114</link>

		<dc:creator><![CDATA[Weq]]></dc:creator>
		<pubDate>Tue, 15 Sep 2015 01:21:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.cognim.co.uk/?p=5231#comment-114</guid>

					<description><![CDATA[Builders are great for reducing API documentation. But I think in this situation u should actually be switching to a mocking library that supports your workflow in a fluent manner, instead of using Moq just becasue Microsoft has included it as a default option.

NSubstitute
AutoFixture
FluentAssertions

var id = testparam;
var customer = new Fixture().Create();
var mockRepo = Substitute.For();
mockRepo.GetById(id).Returns(customer)

var sut = new Sut(mockRepo);
var result = sut.Action();

result.Should.Be(customer, &quot;the customer should be located&quot;);]]></description>
			<content:encoded><![CDATA[<p>Builders are great for reducing API documentation. But I think in this situation u should actually be switching to a mocking library that supports your workflow in a fluent manner, instead of using Moq just becasue Microsoft has included it as a default option.</p>
<p>NSubstitute<br />
AutoFixture<br />
FluentAssertions</p>
<p>var id = testparam;<br />
var customer = new Fixture().Create();<br />
var mockRepo = Substitute.For();<br />
mockRepo.GetById(id).Returns(customer)</p>
<p>var sut = new Sut(mockRepo);<br />
var result = sut.Action();</p>
<p>result.Should.Be(customer, &#8220;the customer should be located&#8221;);</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
