Click here to Skip to main content
12,446,418 members (55,383 online)
Click here to Skip to main content

Stats

95.5K views
288 downloads
176 bookmarked
Posted

How design patterns can help you in developing unit testing-enabled applications

, 15 Nov 2007 CPOL
This article shows how you can mix together Model-View-Presenter, Domain Model, Services, ActiveRecord, and Repository patterns to create a testable application.
nunit.framework.dll
Northwind.DataAccess
Northwind.DataAccess.csproj.user
Properties
Query
Repository
Northwind.DataAccess.Test
Northwind.DataAccess.Test.csproj.user
Properties
Northwind.Domain
Dao
Model
Northwind.Domain.csproj.user
Presentation
Properties
Repository
TransferObjects
Northwind.Domain.Test
Northwind.Domain.Test.csproj.user
Properties
Northwind.Presentation
Northwind.Presentation.csproj.user
Properties
Northwind.Presentation.Test
Northwind.Presentation.Test.csproj.user
Properties
Northwind.Services
Northwind.Services.csproj.user
Properties
Northwind.Services.Test
Northwind.Services.Test.csproj.user
Properties
Northwind.TransferObjects
Model
Northwind.TransferObjects.csproj.user
Presentation
Properties
Northwind.TransferObjects.Test
Northwind.TransferObjects.Test.csproj.user
Properties
Northwind.UI
Northwind.UI.csproj.user
NorthWind.UI.suo
Properties
Northwind.UI.Controls
Northwind.UI.Controls.csproj.user
Properties
Castle.ActiveRecord.dll
Castle.Core.dll
Iesi.Collections.dll
log4net.dll
NHibernate.dll
NMock2.dll
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{D7CEFFFD-1EF4-4760-A41F-FA4AA559B1BB}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Northwind.TransferObjects</RootNamespace>
    <AssemblyName>Northwind.TransferObjects</AssemblyName>
  </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="Castle.ActiveRecord, Version=0.0.1.3, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />
    <Reference Include="Castle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />
    <Reference Include="Iesi.Collections, Version=1.0.0.1, Culture=neutral, PublicKeyToken=154fdcb44c4484fc" />
    <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905" />
    <Reference Include="NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Model\CustomerTO.cs" />
    <Compile Include="Model\OrderTO.cs" />
    <Compile Include="Presentation\CustomerToLookupConverter.cs" />
    <Compile Include="Presentation\IActionButton.cs" />
    <Compile Include="Presentation\ILookupCollection.cs" />
    <Compile Include="Presentation\ILookupList.cs" />
    <Compile Include="Presentation\ILookupTO.cs" />
    <Compile Include="Presentation\IObjectToLookupConverter.cs" />
    <Compile Include="Presentation\IOrderCollection.cs" />
    <Compile Include="Presentation\IOrderList.cs" />
    <Compile Include="Presentation\IPanel.cs" />
    <Compile Include="Presentation\LookupCollection.cs" />
    <Compile Include="Presentation\ObjectToLookupConverter.cs" />
    <Compile Include="Presentation\OrderCollection.cs" />
    <Compile Include="Presentation\OrderToLookupConverter.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Presentation\SimpleLookupTO.cs" />
    <Compile Include="Presentation\TOHelper.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Northwind.Domain\Northwind.Domain.csproj">
      <Project>{10B46AA4-7070-47D7-9E6B-4173AEACE38D}</Project>
      <Name>Northwind.Domain</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\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>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160811.3 | Last Updated 15 Nov 2007
Article Copyright 2007 by Marcelo Ricardo de Oliveira
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid