NANT CruiseControl NUnit – How to get unit tests running and displaying on the build server

<target name=”webtest” haltonfailure=”false” failonerror=”true”> <echo message=”Running unit tests”/> <echo message=”${project.local.folder}”/> <property name=”test_dll_folder” value=”${project.local.folder}\McKelt.Tests\bin\Debug\”/> <exec failonerror=”true” program=”${nunit-console.exe}” workingdir=”${project.local.folder}” verbose=”true” append=”true” commandline=”${test_dll_folder}McKelt.Tests.dll /xml=${test_dll_folder}TestResults.xml /output=${test_dll_folder}TestOutput.txt /err=${test_dll_folder}TestErrorOutput.txt”> </exec> <echo message=”– TEST COMPLETE — “/> </target>   Follow these instructions […]

RhinoMocks – WhenCalled

The following test would fail without this   .WhenCalled(invocation => invocation.ReturnValue = new TestResult(){IsTrue = true, Message = “BBB”})     using System; using System.Collections.Generic; using System.Linq; using System.Text; using Matlock.Core.Shared; using Microsoft.VisualStudio.TestTools.UnitTesting; using Rhino.Mocks; […]

WPF UI Thread Dispatcher

A simple implemention for calling asych methods from the UI   Examples   1. dispatcher.ExecuteOnMainUIThread(CommandManager.InvalidateRequerySuggested);   2. dispatcher.Execute(() => { SomeLongRunningMethodHere(); });   The interface using System; namespace Mvvm { public interface IDispatcher { void […]

Allow IIS7 to download .config files

1. In the following file C:\Windows\System32\inetsrv\config\applicationHost.config Ensure the following <section name=”requestFiltering” overrideModeDefault=”Allow” /> 2 This is the web.config file   <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <handlers> <clear /> <add name=”StaticFile” path=”*” verb=”*” modules=”StaticFileModule,DefaultDocumentModule,DirectoryListingModule” resourceType=”Either” requireAccess=”Read” […]