Revision: 64
Author: goeran.hansen
Date: Tue Nov 3 14:28:09 2009
Log: Started on unit tests for the specifications
http://code.google.com/p/tinybdd/source/detail?r=64
Added:
/trunk/TinyBDD.Specification.NUnitTests
/trunk/TinyBDD.Specification.NUnitTests/Properties
/trunk/TinyBDD.Specification.NUnitTests/Properties/AssemblyInfo.cs
/trunk/TinyBDD.Specification.NUnitTests/ShouldThrowExceptionSpecs.cs
/trunk/TinyBDD.Specification.NUnitTests/TinyBDD.Specification.NUnitTests.csproj
Modified:
/trunk/BuildScript.msbuild
/trunk/TinyBDD.sln
=======================================
--- /dev/null
+++ /trunk/TinyBDD.Specification.NUnitTests/Properties/AssemblyInfo.cs Tue
Nov 3 14:28:09 2009
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the
following
+// set of attributes. Change these attribute values to modify the
information
+// associated with an assembly.
+[assembly: AssemblyTitle("TinyBDD.Specification.NUnitTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("TinyBDD.Specification.NUnitTests")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is
exposed to COM
+[assembly: Guid("a5f9afb1-52c2-423c-9fa6-72dd05c7bf30")]
+
+// Version information for an assembly consists of the following four
values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and
Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /dev/null
+++ /trunk/TinyBDD.Specification.NUnitTests/ShouldThrowExceptionSpecs.cs
Tue Nov 3 14:28:09 2009
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+
+using TinyBDD.Specification.NUnit;
+
+namespace TinyBDD.SpecificationTests.NUnit.SpecificationExtensionsSpecs
+{
+ [TestFixture]
+ public class ShouldThrowExceptionSpecs
+ {
+ [Test]
+ public void
Should_throw_AssertionException_if_specified_exception_is_not_thrown()
+ {
+ bool exceptionThrown = false;
+ try
+ {
+ this.ShouldThrowException<Exception>(() => { }, ex => { });
+ }
+ catch (AssertionException ex)
+ {
+ exceptionThrown = true;
+ }
+
+ Assert.IsTrue(exceptionThrown, "AssertionException was not
thrown");
+ }
+
+ [Test]
+ public void
Should_not_throw_AssertionException_if_specified_exception_is_thrown()
+ {
+ bool exceptionThrown = false;
+
+ try
+ {
+ this.ShouldThrowException<ArgumentNullException>(() =>
+ {
+ throw new ArgumentNullException();
+ }, ex => {});
+ }
+ catch (AssertionException)
+ {
+ exceptionThrown = true;
+ }
+
+ Assert.IsFalse(exceptionThrown, "AssertionException was not
thrown");
+ }
+ }
+}
=======================================
--- /dev/null
+++
/trunk/TinyBDD.Specification.NUnitTests/TinyBDD.Specification.NUnitTests.csproj
Tue Nov 3 14:28:09 2009
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="
http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{6D1DBDF8-40DA-4FF3-8517-50B8E7B72339}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>TinyBDD.Specification.NUnitTests</RootNamespace>
+ <AssemblyName>TinyBDD.Specification.NUnitTests</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework, Version=2.2.10.0,
Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\Tools\NUnit 2.2.1\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="ShouldThrowExceptionSpecs.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference
Include="..\TinyBDD.Specification.NUnit\TinyBDD.Specification.NUnit.csproj">
+ <Project>{3430EDDF-5AE1-4CDB-BCAD-52E28CF09145}</Project>
+ <Name>TinyBDD.Specification.NUnit</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
=======================================
--- /trunk/BuildScript.msbuild Wed Jun 3 05:09:25 2009
+++ /trunk/BuildScript.msbuild Tue Nov 3 14:28:09 2009
@@ -5,7 +5,7 @@
<Import Project="Tools\MSBuild Extension
Pack\MSBuild.ExtensionPack.tasks"/>
<PropertyGroup>
- <TestRunnerDirectory>Tools\NUnit 2.2\</TestRunnerDirectory>
+ <TestRunnerDirectory>Tools\NUnit 2.2.1\</TestRunnerDirectory>
<TestRunnerCommand>nunit-console.exe</TestRunnerCommand>
<Artifacts>$(CCNetArtifactDirectory)</Artifacts>
<ExtensionTasksPath>..\..\Tools\MSBuild Extension
Pack\</ExtensionTasksPath>
=======================================
--- /trunk/TinyBDD.sln Tue Nov 3 14:08:16 2009
+++ /trunk/TinyBDD.sln Tue Nov 3 14:28:09 2009
@@ -33,6 +33,8 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "TinyBDD.Specification.NUnit.2.4.7", "TinyBDD.Specification.NUnit.2.4.7\TinyBDD.Specification.NUnit.2.4.7.csproj", "{7E2D2DE4-0838-4680-8090-FD24D4365AD3}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "TinyBDD.Specification.NUnitTests", "TinyBDD.Specification.NUnitTests\TinyBDD.Specification.NUnitTests.csproj", "{6D1DBDF8-40DA-4FF3-8517-50B8E7B72339}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -87,6 +89,10 @@
{7E2D2DE4-0838-4680-8090-FD24D4365AD3}.Debug|Any CPU.Build.0 = Debug|Any
CPU
{7E2D2DE4-0838-4680-8090-FD24D4365AD3}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{7E2D2DE4-0838-4680-8090-FD24D4365AD3}.Release|Any CPU.Build.0 = Release|
Any CPU
+ {6D1DBDF8-40DA-4FF3-8517-50B8E7B72339}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {6D1DBDF8-40DA-4FF3-8517-50B8E7B72339}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {6D1DBDF8-40DA-4FF3-8517-50B8E7B72339}.Release|Any CPU.ActiveCfg =
Release|Any CPU
+ {6D1DBDF8-40DA-4FF3-8517-50B8E7B72339}.Release|Any CPU.Build.0 = Release|
Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -99,5 +105,6 @@
{297044DC-DEF3-4083-8F29-3042F1E89EAA} =
{FF395234-3263-46AE-A976-0D1F2E5CE076}
{FD0A7030-AEBC-49C4-B5B6-2EE512F02C82} =
{FF395234-3263-46AE-A976-0D1F2E5CE076}
{7E2D2DE4-0838-4680-8090-FD24D4365AD3} =
{FF395234-3263-46AE-A976-0D1F2E5CE076}
+ {6D1DBDF8-40DA-4FF3-8517-50B8E7B72339} =
{FF395234-3263-46AE-A976-0D1F2E5CE076}
EndGlobalSection
EndGlobal