XUnit Ignore test at runtime (with SpecFlow tag @IgnoreLocally)

XUnit Ignore test at runtime (with SpecFlow tag @IgnoreLocally) Code –> https://github.com/chrismckelt/XUnit.OptionallyIgnore NuGet –> https://www.nuget.org/packages/Xunit.SpecFlow.AssertSkip/ As Xunit has no Assert.Ignore() using the OptionallyIgnoreTestFactAttribute attribute on a method and setting McKeltCustom.SpecflowPlugin.Settings.IgnoreLocally == true will ignore the test […]

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; […]

Context Specification

tnamespace Example { using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using Rhino.Mocks; public abstract class ContextSpecification<T> { protected Exception executionException; protected T sut { get; set; } [TestInitialize] public void Start() { this.Context(); this.SetupMockResults(); this.Because(); } [TestCleanup] public […]