Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DominicCronin/T-cubed
Browse files Browse the repository at this point in the history
  • Loading branch information
andreym committed Sep 27, 2013
2 parents 5f51006 + 0889987 commit e2ea8c0
Show file tree
Hide file tree
Showing 10 changed files with 362 additions and 0 deletions.
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6281540E-35D0-4A61-9F09-B749BCB2D7A9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MockCustomerImplementation</RootNamespace>
<AssemblyName>MockCustomerImplementation</AssemblyName>
<TargetFrameworkVersion>v4.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="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Tridion.Common">
<HintPath>..\..\ReferenceAssemblies\Tridion.Common.dll</HintPath>
</Reference>
<Reference Include="Tridion.ContentManager.Common">
<HintPath>..\..\ReferenceAssemblies\Tridion.ContentManager.Common.dll</HintPath>
</Reference>
<Reference Include="Tridion.ContentManager.Publishing">
<HintPath>..\..\ReferenceAssemblies\Tridion.ContentManager.Publishing.dll</HintPath>
</Reference>
<Reference Include="Tridion.ContentManager.Templating">
<HintPath>..\..\ReferenceAssemblies\Tridion.ContentManager.Templating.dll</HintPath>
</Reference>
<Reference Include="Tridion.Logging">
<HintPath>..\..\ReferenceAssemblies\Tridion.Logging.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="SampleSetup.cs" />
<Compile Include="SampleTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TestingFrameworkCore\TestingFrameworkCore.csproj">
<Project>{b75ac99d-951e-4391-9a2f-936e6d155ccb}</Project>
<Name>TestingFrameworkCore</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>
@@ -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("MockCustomerImplementation")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Hewlett-Packard")]
[assembly: AssemblyProduct("MockCustomerImplementation")]
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2013")]
[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("3168aa36-22b0-46af-a45f-e074a3dd034c")]

// 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")]
18 changes: 18 additions & 0 deletions TestingFramework/MockCustomerImplementation/SampleSetup.cs
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tridion.Extensions.Testing;

namespace MockCustomerImplementation
{
public class SampleSetup : BaseSetup
{

public override void Setup()
{
throw new NotImplementedException();
}
}
}
17 changes: 17 additions & 0 deletions TestingFramework/MockCustomerImplementation/SampleTest.cs
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tridion.Extensions.Testing;

namespace MockCustomerImplementation
{
public class SampleTest : BaseTest
{
public override void Test()
{
throw new NotImplementedException();
}
}
}
12 changes: 12 additions & 0 deletions TestingFramework/TestingFramework.sln
Expand Up @@ -3,6 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReplaceComponentItem", "ReplaceComponentItem\ReplaceComponentItem.csproj", "{CC2B7BE1-F783-4510-B42A-0262939D1886}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestingFrameworkCore", "TestingFrameworkCore\TestingFrameworkCore.csproj", "{B75AC99D-951E-4391-9A2F-936E6D155CCB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MockCustomerImplementation", "MockCustomerImplementation\MockCustomerImplementation.csproj", "{6281540E-35D0-4A61-9F09-B749BCB2D7A9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -13,6 +17,14 @@ Global
{CC2B7BE1-F783-4510-B42A-0262939D1886}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC2B7BE1-F783-4510-B42A-0262939D1886}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC2B7BE1-F783-4510-B42A-0262939D1886}.Release|Any CPU.Build.0 = Release|Any CPU
{B75AC99D-951E-4391-9A2F-936E6D155CCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B75AC99D-951E-4391-9A2F-936E6D155CCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B75AC99D-951E-4391-9A2F-936E6D155CCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B75AC99D-951E-4391-9A2F-936E6D155CCB}.Release|Any CPU.Build.0 = Release|Any CPU
{6281540E-35D0-4A61-9F09-B749BCB2D7A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6281540E-35D0-4A61-9F09-B749BCB2D7A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6281540E-35D0-4A61-9F09-B749BCB2D7A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6281540E-35D0-4A61-9F09-B749BCB2D7A9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
36 changes: 36 additions & 0 deletions TestingFramework/TestingFrameworkCore/BaseGeneric.cs
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tridion.ContentManager.Templating;
using Tridion.ContentManager.Templating.Assembly;

namespace Tridion.Extensions.Testing
{
public abstract class BaseGeneric : ITemplate
{
protected Engine Engine { get; set; }
protected Package Package { get; set; }
private TemplatingLogger _logger = null;
protected virtual TemplatingLogger Logger
{
get
{
if (_logger == null)
{
_logger = TemplatingLogger.GetLogger(this.GetType());
}
return _logger;
}
}

public void Transform(Engine engine, Package package)
{
Engine = engine;
Package = package;
Transform();
}
public abstract void Transform();
}
}
30 changes: 30 additions & 0 deletions TestingFramework/TestingFrameworkCore/BaseSetup.cs
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tridion.ContentManager.Templating;
using Tridion.ContentManager.Templating.Assembly;

namespace Tridion.Extensions.Testing
{
public abstract class BaseSetup : BaseGeneric
{


public override void Transform()
{
Setup();
}

public abstract void Setup();


#region Package manipulation methods
protected void SetPackageItem(string name, string value)
{
Package.GetByName(name).SetAsString(value);
}
#endregion
}
}
32 changes: 32 additions & 0 deletions TestingFramework/TestingFrameworkCore/BaseTest.cs
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tridion.ContentManager.Templating;
using Tridion.ContentManager.Templating.Assembly;

namespace Tridion.Extensions.Testing
{
public abstract class BaseTest : BaseGeneric
{


public override void Transform()
{
Test();
}

public abstract void Test();


#region Assertion methods
protected bool AssertPackageContains(string name, string value = null)
{
if (value == null)
return Package.GetByName(name) != null;
return Package.GetByName(name) != null ? Package.GetByName(name).GetAsString().Equals(value) : false;
}
#endregion
}
}
36 changes: 36 additions & 0 deletions TestingFramework/TestingFrameworkCore/Properties/AssemblyInfo.cs
@@ -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("TestingFrameworkCore")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Hewlett-Packard")]
[assembly: AssemblyProduct("TestingFrameworkCore")]
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2013")]
[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("c2e0322e-8fae-4c4c-a4a5-1e7f40a75659")]

// 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")]
70 changes: 70 additions & 0 deletions TestingFramework/TestingFrameworkCore/TestingFrameworkCore.csproj
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B75AC99D-951E-4391-9A2F-936E6D155CCB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tridion.Extensions.Testing</RootNamespace>
<AssemblyName>Tridion.Extensions.Testing</AssemblyName>
<TargetFrameworkVersion>v4.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="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Tridion.Common">
<HintPath>..\..\ReferenceAssemblies\Tridion.Common.dll</HintPath>
</Reference>
<Reference Include="Tridion.ContentManager.Common">
<HintPath>..\..\ReferenceAssemblies\Tridion.ContentManager.Common.dll</HintPath>
</Reference>
<Reference Include="Tridion.ContentManager.Publishing">
<HintPath>..\..\ReferenceAssemblies\Tridion.ContentManager.Publishing.dll</HintPath>
</Reference>
<Reference Include="Tridion.ContentManager.Templating">
<HintPath>..\..\ReferenceAssemblies\Tridion.ContentManager.Templating.dll</HintPath>
</Reference>
<Reference Include="Tridion.Logging">
<HintPath>..\..\ReferenceAssemblies\Tridion.Logging.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BaseTest.cs" />
<Compile Include="BaseGeneric.cs" />
<Compile Include="BaseSetup.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>

0 comments on commit e2ea8c0

Please sign in to comment.