Skip to content

Commit 9b9b712

Browse files
author
Nathan Bridgewater
committed
refactoring a little for IOC and testability.
1 parent 0a3bc5b commit 9b9b712

31 files changed

+597
-142
lines changed

Diff for: SubSonicDemo/lib/Castle.Core.dll

280 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/Machine.Specifications.dll

54 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/Machine.Specifications.pdb

182 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/Microsoft.Web.Mvc.dll

136 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/MvcContrib.FluentHtml.dll

54.5 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/MvcContrib.TestHelper.dll

52 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/MvcContrib.dll

198 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/RHINO License.txt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Copyright (c) 2005 - 2009 Ayende Rahien ([email protected])
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
* Neither the name of Ayende Rahien nor the names of its
13+
contributors may be used to endorse or promote products derived from this
14+
software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Diff for: SubSonicDemo/lib/Rhino.Mocks.dll

309 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/SubSonic.Core.dll

31.5 KB
Binary file not shown.

Diff for: SubSonicDemo/lib/SubSonic.Core.pdb

168 KB
Binary file not shown.

Diff for: SubSonicDemo/src/SubSonicDemo.Core/App.config

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0"?>
2+
<configuration>
3+
<!--<configSections>
4+
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/>
5+
</configSections>-->
6+
7+
<!--optional app.config for unity-->
8+
<!--<unity>
9+
<typeAliases>
10+
<typeAlias alias="AppService" type="SubSonicDemo.AppService, SubSonicDemo"/>
11+
<typeAlias alias="LinqAppService" type="SubSonicDemo.LinqAppService, SubSonicDemo"/>
12+
<typeAlias alias="LinqRepository" type="SubSonicDemo.LinqRepository, SubSonicDemo"/>
13+
<typeAlias alias="SS3LinqRepository" type="SubSonicDemo.SS3LinqRepository, SubSonicDemo"/>
14+
<typeAlias alias="MockLinqRepository" type="SubSonicDemo.MockLinqRepository, SubSonicDemo"/>
15+
<typeAlias alias="MockAppService" type="SubSonicDemo.Repository.MockAppService, SubSonicDemo"/>
16+
</typeAliases>
17+
<containers>
18+
<container>
19+
<types>
20+
<type type="AppService" mapTo="LinqAppService"/>
21+
<type type="LinqRepository" mapTo="SS3LinqRepository"/>
22+
</types>
23+
</container>
24+
</containers>
25+
</unity>-->
26+
27+
<connectionStrings>
28+
<clear/>
29+
<add name="Sqlite" providerName="System.Data.SQLite" connectionString="Data Source=data.db3;"/>
30+
<add name="MySql" providerName="MySql.Data.MySqlClient" connectionString="Data Source=localhost;Database=SubSonicDemo;User id=user;password=pass;"/>
31+
<add name="MSSql" providerName="System.Data.SqlClient" connectionString="Data Source=localhost;initial catalog=SubSonicDemo;Integrated Security=true;"/>
32+
</connectionStrings>
33+
34+
<appSettings>
35+
<add key="DefaultConnectionStringName" value="Sqlite"/>
36+
<add key="RunMigrations" value="True"/>
37+
</appSettings>
38+
39+
<system.data>
40+
<DbProviderFactories>
41+
<clear/>
42+
<add name="SQLite Data Provider"
43+
invariant="System.Data.SQLite"
44+
description=".Net Framework Data Provider for SQLite"
45+
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
46+
47+
<add name="MySQL Data Provider"
48+
description="ADO.Net driver for MySQL"
49+
invariant="MySql.Data.MySqlClient"
50+
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data"/>
51+
52+
<add name="MSSQL Data Provider"
53+
description="ADO.Net driver for MSSQL"
54+
invariant="System.Data.SqlClient"
55+
type="System.Data.SqlClient.SqlClientFactory, System.Data"/>
56+
</DbProviderFactories>
57+
</system.data>
58+
</configuration>

Diff for: SubSonicDemo/src/SubSonicDemo/Config.cs renamed to SubSonicDemo/src/SubSonicDemo.Core/Config.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Text;
55
using System.Configuration;
66

7-
namespace SubSonicDemo
7+
namespace SubSonicDemo.Core
88
{
99
public class Config
1010
{

Diff for: SubSonicDemo/src/SubSonicDemo/DemoController.cs renamed to SubSonicDemo/src/SubSonicDemo.Core/DemoController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Linq;
44
using System.Text;
55

6-
namespace SubSonicDemo
6+
namespace SubSonicDemo.Core
77
{
88
public class DemoController
99
{

Diff for: SubSonicDemo/src/SubSonicDemo/Domain/Category.cs renamed to SubSonicDemo/src/SubSonicDemo.Core/Domain/Category.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Text;
55
using SubSonic.SqlGeneration.Schema;
66

7-
namespace SubSonicDemo
7+
namespace SubSonicDemo.Core
88
{
99
//you may optionally specify a custom table name for your domain object.
1010
//If you left this out, it would likely pluralize and pascal case the class name for its table representation

Diff for: SubSonicDemo/src/SubSonicDemo/Domain/Product.cs renamed to SubSonicDemo/src/SubSonicDemo.Core/Domain/Product.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Text;
55
using SubSonic.SqlGeneration.Schema;
66

7-
namespace SubSonicDemo
7+
namespace SubSonicDemo.Core
88
{
99
//not using table name override.
1010
public class Product

Diff for: SubSonicDemo/src/SubSonicDemo/Implementation/LinqAppService.cs renamed to SubSonicDemo/src/SubSonicDemo.Core/Implementation/LinqAppService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Linq;
44
using System.Text;
55

6-
namespace SubSonicDemo
6+
namespace SubSonicDemo.Core
77
{
88

99
/// <summary>

Diff for: SubSonicDemo/src/SubSonicDemo/Implementation/SS3Repository.cs renamed to SubSonicDemo/src/SubSonicDemo.Core/Implementation/SS3Repository.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Text;
55
using SubSonic.Repository;
66

7-
namespace SubSonicDemo
7+
namespace SubSonicDemo.Core
88
{
99
public class SS3LinqRepository : LinqRepository
1010
{

Diff for: SubSonicDemo/src/SubSonicDemo/Interfaces/AppService.cs renamed to SubSonicDemo/src/SubSonicDemo.Core/Interfaces/AppService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Linq;
44
using System.Text;
55

6-
namespace SubSonicDemo
6+
namespace SubSonicDemo.Core
77
{
88
public interface AppService
99
{

Diff for: SubSonicDemo/src/SubSonicDemo/Interfaces/LinqRepository.cs renamed to SubSonicDemo/src/SubSonicDemo.Core/Interfaces/LinqRepository.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Linq;
44
using System.Text;
55

6-
namespace SubSonicDemo
6+
namespace SubSonicDemo.Core
77
{
88
public interface LinqRepository
99
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("SubSonicDemo.Core")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("SubSonicDemo.Core")]
13+
[assembly: AssemblyCopyright("Copyright © 2010")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("41177506-c9ce-456e-9780-2e8d15a2b870")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>9.0.30729</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{44704D1B-6706-4B1F-B66A-4A3AD037AE27}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>SubSonicDemo.Core</RootNamespace>
12+
<AssemblyName>SubSonicDemo.Core</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="mysql.data, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
35+
<SpecificVersion>False</SpecificVersion>
36+
<HintPath>..\..\lib\mysql.data.dll</HintPath>
37+
</Reference>
38+
<Reference Include="SubSonic.Core, Version=3.0.0.3, Culture=neutral, processorArchitecture=MSIL">
39+
<SpecificVersion>False</SpecificVersion>
40+
<HintPath>..\..\lib\SubSonic.Core.dll</HintPath>
41+
</Reference>
42+
<Reference Include="System" />
43+
<Reference Include="System.configuration" />
44+
<Reference Include="System.Core">
45+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
46+
</Reference>
47+
<Reference Include="System.Xml.Linq">
48+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
49+
</Reference>
50+
<Reference Include="System.Data.DataSetExtensions">
51+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
52+
</Reference>
53+
<Reference Include="System.Data" />
54+
<Reference Include="System.Xml" />
55+
<Reference Include="Sytem.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
56+
<SpecificVersion>False</SpecificVersion>
57+
<HintPath>..\..\lib\Sytem.Data.SQLite.dll</HintPath>
58+
</Reference>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<Compile Include="Config.cs" />
62+
<Compile Include="DemoController.cs" />
63+
<Compile Include="Domain\Category.cs" />
64+
<Compile Include="Domain\Product.cs" />
65+
<Compile Include="Implementation\LinqAppService.cs" />
66+
<Compile Include="Implementation\SS3Repository.cs" />
67+
<Compile Include="Interfaces\AppService.cs" />
68+
<Compile Include="Interfaces\LinqRepository.cs" />
69+
<Compile Include="Properties\AssemblyInfo.cs" />
70+
</ItemGroup>
71+
<ItemGroup>
72+
<None Include="App.config">
73+
<SubType>Designer</SubType>
74+
</None>
75+
</ItemGroup>
76+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
77+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
78+
Other similar extension points exist, see Microsoft.Common.targets.
79+
<Target Name="BeforeBuild">
80+
</Target>
81+
<Target Name="AfterBuild">
82+
</Target>
83+
-->
84+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("SubSonicDemo.Specs")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("SubSonicDemo.Specs")]
13+
[assembly: AssemblyCopyright("Copyright © 2010")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("7918326a-2716-41fc-b5c5-a8f6333c6169")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)