diff options
Diffstat (limited to 'src/YOURLIBNAME.Test')
-rw-r--r-- | src/YOURLIBNAME.Test/Logging.config | 33 | ||||
-rw-r--r-- | src/YOURLIBNAME.Test/Properties/AssemblyInfo.cs | 23 | ||||
-rw-r--r-- | src/YOURLIBNAME.Test/TestBase.cs | 25 | ||||
-rw-r--r-- | src/YOURLIBNAME.Test/YOURLIBNAME.Test.csproj | 75 |
4 files changed, 156 insertions, 0 deletions
diff --git a/src/YOURLIBNAME.Test/Logging.config b/src/YOURLIBNAME.Test/Logging.config new file mode 100644 index 0000000..a1d675b --- /dev/null +++ b/src/YOURLIBNAME.Test/Logging.config @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8" ?>
+<log4net>
+ <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
+ <file value="Testing.log" />
+ <appendToFile value="true" />
+ <rollingStyle value="Size" />
+ <maxSizeRollBackups value="10" />
+ <maximumFileSize value="1024KB" />
+ <staticLogFileName value="true" />
+ <layout type="log4net.Layout.PatternLayout">
+ <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
+ </layout>
+ </appender>
+ <appender name="TraceAppender" type="log4net.Appender.TraceAppender">
+ <immediateFlush value="true" />
+ <layout type="log4net.Layout.PatternLayout">
+ <conversionPattern value="%-5level - %message%newline" />
+ </layout>
+ </appender>
+ <!-- Setup the root category, add the appenders and set the default level -->
+ <root>
+ <level value="Info" />
+ <!--<appender-ref ref="RollingFileAppender" />-->
+ <appender-ref ref="TraceAppender" />
+ </root>
+ <!-- Specify the level for some specific categories -->
+ <logger name="DotNetOpenId">
+ <level value="Off" />
+ </logger>
+ <logger name="DotNetOpenId.Test">
+ <level value="Info" />
+ </logger>
+</log4net>
diff --git a/src/YOURLIBNAME.Test/Properties/AssemblyInfo.cs b/src/YOURLIBNAME.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d065d7a --- /dev/null +++ b/src/YOURLIBNAME.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +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("YOURLIBNAME.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("YOURLIBNAME.Test")]
+[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM componenets. 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("aef0bb13-b79c-4854-a69a-de58b8feb5d1")]
diff --git a/src/YOURLIBNAME.Test/TestBase.cs b/src/YOURLIBNAME.Test/TestBase.cs new file mode 100644 index 0000000..3c9788f --- /dev/null +++ b/src/YOURLIBNAME.Test/TestBase.cs @@ -0,0 +1,25 @@ +using System.Reflection;
+using log4net;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace YOURLIBNAME.Test {
+ public class TestBase {
+ internal readonly static ILog Logger = LogManager.GetLogger("YOURLIBNAME.Test");
+
+ /// <summary>
+ /// Gets or sets the test context which provides
+ /// information about and functionality for the current test run.
+ /// </summary>
+ public TestContext TestContext { get; set; }
+
+ [TestInitialize]
+ public virtual void SetUp() {
+ log4net.Config.XmlConfigurator.Configure(Assembly.GetExecutingAssembly().GetManifestResourceStream("YOURLIBNAME.Test.Logging.config"));
+ }
+
+ [TestCleanup]
+ public virtual void Cleanup() {
+ log4net.LogManager.Shutdown();
+ }
+ }
+}
diff --git a/src/YOURLIBNAME.Test/YOURLIBNAME.Test.csproj b/src/YOURLIBNAME.Test/YOURLIBNAME.Test.csproj new file mode 100644 index 0000000..1dd166f --- /dev/null +++ b/src/YOURLIBNAME.Test/YOURLIBNAME.Test.csproj @@ -0,0 +1,75 @@ +<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>{4376ECC9-C346-4A99-B13C-FA93C0FBD2C9}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>YOURLIBNAME.Test</RootNamespace>
+ <AssemblyName>YOURLIBNAME.Test</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ </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>
+ <PropertyGroup Condition=" '$(Sign)' == 'true' ">
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>..\official-build-key.pfx</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Runtime.Serialization">
+ <RequiredTargetFramework>3.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Web" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="TestBase.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\YOURLIBNAME\YOURLIBNAME.csproj">
+ <Project>{3191B653-F76D-4C1A-9A5A-347BC3AAAAB7}</Project>
+ <Name>YOURLIBNAME</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Logging.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="..\..\tools\YOURLIBNAME.Versioning.targets" />
+</Project>
\ No newline at end of file |