<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Testing - Tag - Joel Beckham</title><link>http://example.org/tags/testing/</link><description>Testing - Tag - Joel Beckham</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Wed, 11 Jan 2012 00:00:00 +0000</lastBuildDate><atom:link href="http://example.org/tags/testing/" rel="self" type="application/rss+xml"/><item><title>Selenium WebDriver: PageObjects Pattern</title><link>http://example.org/posts/2012/2012-01-11-selenium-webdriver-pageobjects-pattern/</link><pubDate>Wed, 11 Jan 2012 00:00:00 +0000</pubDate><author>jbeckham</author><guid>http://example.org/posts/2012/2012-01-11-selenium-webdriver-pageobjects-pattern/</guid><description>As you increase the number of functional tests against your site, you will find a lot of duplicate code. This increasingly makes maintenance difficult because a single UI change will require many changes across the tests. In response, Selenium has suggested the PageObjects pattern which represents each page on your site as an object. The details of interacting with a page is moved out of the test and into the page object.</description></item><item><title>NUnit Categories</title><link>http://example.org/posts/2011/2011-12-08-nunit-categories/</link><pubDate>Thu, 08 Dec 2011 00:00:00 +0000</pubDate><author>jbeckham</author><guid>http://example.org/posts/2011/2011-12-08-nunit-categories/</guid><description>Sometimes I want to only run a portion of my tests. nUnit allows tests to be labeled with Categories and then selectively choose which categories you want to run. I have found this especially helpful on TeamCity for integration tests because I don&amp;rsquo;t have all the infrastructure set up to successfully execute all of my tests. I have created a Category called &amp;ldquo;Always&amp;rdquo; and marked the tests that can run on TeamCity with this category.</description></item><item><title>Unit Testing: Testing methods that rely on DateTime.Now</title><link>http://example.org/posts/2011/2011-08-19-unit-testing-testing-methods-that-rely-on-datetime-now/</link><pubDate>Fri, 19 Aug 2011 00:00:00 +0000</pubDate><author>jbeckham</author><guid>http://example.org/posts/2011/2011-08-19-unit-testing-testing-methods-that-rely-on-datetime-now/</guid><description>I have a class whose behavior depends on the time of day. It called DateTime.Now directly to get the current time. Doing it this way makes it difficult to write tests to prove that all use cases work as expected.
One simple solution is to add a delegate called Now to the class. By default it points to an anonymous method which returns DateTime.Now:
public Func&amp;lt;DateTime&amp;gt; Now = () =&amp;gt; DateTime.</description></item></channel></rss>