Skip to content

Commit

Permalink
Changed SL unit tests to use xUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
remogloor committed May 15, 2011
1 parent 78e23e0 commit 4ab2f2a
Show file tree
Hide file tree
Showing 55 changed files with 1,175 additions and 2,187 deletions.
17 changes: 9 additions & 8 deletions Ninject.MockingKernel.build
Expand Up @@ -47,7 +47,6 @@
<copy todir="${current.path.test}">
<fileset basedir="${path.tools.xunit}">
<include name="xunit.dll"/>
<include name="xunit.should.dll"/>
</fileset>
</copy>
<csc noconfig="true" warnaserror="true" target="library" debug="${build.debug}" optimize="${build.optimize}" define="${build.defines}"
Expand All @@ -69,7 +68,6 @@
<include name="Rhino.Mocks.dll"/>
<include name="NSubstitute.dll"/>
<include name="xunit.dll"/>
<include name="xunit.should.dll"/>
<include name="${product.assembly}"/>
<include name="${product.assembly.moq}"/>
<include name="${product.assembly.rhinomock}"/>
Expand All @@ -90,8 +88,8 @@
</fileset>
</copy>
<copy todir="${current.path.test}">
<fileset basedir="${path.tools.unitdriven}">
<include name="UnitDrivenLight.dll"/>
<fileset basedir="${path.tools.xunit.sl}${build.platform}">
<include name="*.dll"/>
</fileset>
</copy>
<csc noconfig="true" warnaserror="true" target="library" debug="${build.debug}" optimize="${build.optimize}" define="${build.defines}"
Expand All @@ -112,12 +110,15 @@
<include name="System.Windows.dll"/>
<include name="System.Windows.Browser.dll"/>
<include name="System.Net.dll"/>
<include name="Moq.Silverlight.dll"/>
<include name="Rhino.Mocks 3.5.Silverlight.dll"/>
<include name="Castle.Core.dll" if="${string::contains(build.platform, 'silverlight-4.0')}"/>
<include name="Microsoft.Phone.dll" if="${string::contains(build.platform, 'wp7')}"/>
<include name="Microsoft.Phone.Interop.dll" if="${string::contains(build.platform, 'wp7')}"/>
<include name="Moq.Silverlight.dll" unless="${string::contains(build.platform, 'wp7')}"/>
<include name="Castle.Core.dll" if="${build.platform == 'silverlight-4.0'}"/>
<include name="Castle.Core-Silverlight.dll" unless="${string::contains(build.platform, 'silverlight-4.0')}"/>
<include name="Castle.DynamicProxy-Silverlight.dll" unless="${string::contains(build.platform, 'silverlight-4.0')}"/>
<include name="UnitDrivenLight.dll"/>
<include name="xunit.runner.silverlight.dll"/>
<include name="xunit-silverlight.dll"/>
<include name="Rhino.Mocks 3.5.Silverlight.dll"/>
<include name="${product.assembly}"/>
<include name="${product.assembly.moq}"/>
<!--<include name="${product.assembly.rhinomock}"/>-->
Expand Down
22 changes: 13 additions & 9 deletions Ninject.include
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project name="NinjectIncludes">

<property name="teamcity" value="false" overwrite="false"/>
<property name="path.base" value="${project::get-base-directory()}"/>
<property name="path.build" value="${path.base}/build"/>
<property name="path.lib" value="${path.base}/lib"/>
Expand All @@ -9,13 +10,13 @@
<property name="path.src" value="${path.base}/src"/>
<property name="path.build.assemblyinfo" value="${path.src}/${build.asminfo}" dynamic="true"/>
<property name="path.tools" value="${path.base}/tools"/>
<property name="path.tools.xunit.sl" value="${path.tools}/xunit.sl/"/>
<property name="path.tools.xunit" value="${path.tools}/xunit.net"/>
<property name="path.tools.xunit.console" value="${path.tools.xunit}/xunit.console.exe" dynamic="true"/>
<property name="path.tools.moq" value="${path.tools}/moq"/>
<property name="path.tools.ncover" value="${path.tools}/ncover"/>
<property name="path.tools.git" value="${path.tools}/git"/>
<property name="path.tools.statlight" value="${path.tools}/statlight/statlight.exe"/>
<property name="path.tools.unitdriven" value="${path.tools}/unitdriven"/>
<property name="path.tools.nuget" value="${path.tools}/nuget/nuget.exe"/>

<property name="product.keyfile" value="Ninject.snk" overwrite="false"/>
Expand All @@ -26,6 +27,7 @@
<property name="product.assembly.silverlighttestdll" value="${product.name}.SilverlightTests.dll" overwrite="false"/>
<property name="product.additionalVersionTag" value="" overwrite="false"/>
<property name="product.clsCompliant" value="true" overwrite="false"/>
<property name="product.packagePostfix" value="" overwrite="false"/>

<property name="version.major" value="${version::get-major(version::parse(version))}" dynamic="true"/>
<property name="version.minor" value="${version::get-minor(version::parse(version))}" dynamic="true"/>
Expand Down Expand Up @@ -114,9 +116,9 @@
<target name="InitializeBuildSystem" depends="DetectOperatingSystemArchitecture"/>

<target name="create-assembly-info" depends="get-git-revision">
<echo message="##teamcity[buildVersionNumber '${build.version}']" />
<echo message="##assembly[assemblyVersionNumber '${build.assemblyversion}']" />
<echo message="##assembly[buildPlatform '${build.platform}']" />
<echo message="##teamcity[buildNumber '${build.version}']" />
<echo message="Assembly Version: '${build.assemblyversion}'" />
<echo message="Build Platform: '${build.platform}'" />

<asminfo output="${path.build.assemblyinfo}" language="CSharp">
<imports>
Expand Down Expand Up @@ -246,7 +248,7 @@

<target name="config-platform-silverlight-4.0-wp7">
<property name="nant.settings.currentframework" value="silverlight-4.0-wp7"/>
<property name="build.defines" value="${global.build.defines},SILVERLIGHT,SILVERLIGHT_40,WINDOWS_PHONE,NO_LCG,NO_ASSEMBLY_SCANNING,NO_WEB,NO_PARTIAL_TRUST,NO_SKIP_VISIBILITY,NO_EXCEPTION_SERIALIZATION,NO_DEBUG_SYMBOLS"/>
<property name="build.defines" value="${global.build.defines},SILVERLIGHT,SILVERLIGHT_40,WINDOWS_PHONE,NO_LCG,NO_ASSEMBLY_SCANNING,NO_WEB,NO_PARTIAL_TRUST,NO_SKIP_VISIBILITY,NO_EXCEPTION_SERIALIZATION,NO_DEBUG_SYMBOLS, NO_MOQ"/>
<property name="nuget.platform" value="sl3-wp"/>
<property name="nuget.add" value="true"/>
</target>
Expand Down Expand Up @@ -277,8 +279,10 @@
</if>
</target>

<target name="silverlight-test" depends="compile-silverlight-tests" unless="${skip.tests or skip.silverlightTests}" if="${string::contains(build.platform, 'silverlight')}">
<exec program="${path.tools.statlight}" workingdir="${current.path.test}" commandline='-x"${product.assembly.silverlighttest}" -o=UnitDriven --teamcity' failonerror="true"/>
<target name="silverlight-test" depends="compile-silverlight-tests" unless="${skip.tests or skip.silverlightTests or string::contains(build.platform, 'wp7')}" if="${string::contains(build.platform, 'silverlight')}">
<property name="cmdLine" value='-x"${product.assembly.silverlighttest}" --teamcity' if="${teamcity}"/>
<property name="cmdLine" value='-x"${product.assembly.silverlighttest}"' unless="${teamcity}"/>
<exec program="${path.tools.statlight}" workingdir="${current.path.test}" commandline="${cmdLine}" failonerror="true"/>
</target>

<target name="UnzipDependencies">
Expand Down Expand Up @@ -328,7 +332,7 @@

<target name="package-bin" depends="create-assembly-info all">
<mkdir dir="${path.dist}" if="${not(directory::exists(path.dist))}"/>
<zip zipfile="${path.dist}\${product.name}-${build.version}-${product.additionalVersionTag}${build.config}-${build.platform}.zip" ziplevel="9">
<zip zipfile="${path.dist}\${product.name}${product.packagePostfix}-${build.version}-${product.additionalVersionTag}${build.config}-${build.platform}.zip" ziplevel="9">
<fileset basedir="${current.path.build}">
<include name="**/*.*"/>
</fileset>
Expand All @@ -337,7 +341,7 @@

<target name="package-source" depends="create-assembly-info">
<mkdir dir="${path.dist}" if="${not(directory::exists(path.dist))}"/>
<zip zipfile="${path.dist}\${product.name}-${build.version}-${product.additionalVersionTag}source.zip" ziplevel="9">
<zip zipfile="${path.dist}\${product.name}${product.packagePostfix}-${build.version}-${product.additionalVersionTag}source.zip" ziplevel="9">
<fileset basedir="${path.base}">
<include name="lib/*.*"/>
<include name="**/*.cs"/>
Expand Down
10 changes: 0 additions & 10 deletions src/Ninject.MockingKernel.Moq.Test/MoqIntegrationTest.cs
Expand Up @@ -22,20 +22,10 @@
namespace Ninject.MockingKernel.Moq
{
using global::Moq;
#if SILVERLIGHT
#if SILVERLIGHT_MSTEST
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using UnitDriven;
#endif
#else
using Ninject.MockingKernel.MSTestAttributes;
#endif

/// <summary>
/// Integration test for the moq mocking kernel.
/// </summary>
[TestClass]
public class MoqIntegrationTest : IntegrationTest
{
/// <summary>
Expand Down
Expand Up @@ -36,8 +36,8 @@
</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Moq, Version=4.0.812.4, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\..\lib\moq\net-3.5\Moq.dll</HintPath>
<Reference Include="Moq, Version=4.0.10827.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\..\lib\moq\NET35\Moq.dll</HintPath>
</Reference>
<Reference Include="Ninject">
<HintPath>..\..\lib\Ninject\net-3.5\Ninject.dll</HintPath>
Expand Down
Expand Up @@ -42,7 +42,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Moq">
<HintPath>..\..\lib\moq\net-3.5\Moq.dll</HintPath>
<HintPath>..\..\lib\moq\NET35\Moq.dll</HintPath>
</Reference>
<Reference Include="Ninject">
<HintPath>..\..\lib\Ninject\net-3.5\Ninject.dll</HintPath>
Expand Down
Expand Up @@ -21,23 +21,12 @@

namespace Ninject.MockingKernel.NSubstitute
{
using MSTestAttributes;
using global::NSubstitute;

#if !NO_NSUBSTITUTE_SILVERLIGHT_TESTS
#if SILVERLIGHT
#if SILVERLIGHT_MSTEST
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using UnitDriven;
#endif
#else
#endif

/// <summary>
/// Tests the rhino mocks mocking kernel.
/// </summary>
[TestClass]
public class NSubstituteIntegrationTest : IntegrationTest
{
/// <summary>
Expand Down
Expand Up @@ -22,21 +22,11 @@
namespace Ninject.MockingKernel.RhinoMock
{
#if !NO_RHINOMOCKS_SILVERLIGHT_TESTS
#if SILVERLIGHT
#if SILVERLIGHT_MSTEST
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using UnitDriven;
#endif
#else
using Ninject.MockingKernel.MSTestAttributes;
#endif
using Rhino.Mocks;

/// <summary>
/// Tests the rhino mocks mocking kernel.
/// </summary>
[TestClass]
public class RhinoMocksIntegrationTest : IntegrationTest
{
/// <summary>
Expand Down
8 changes: 2 additions & 6 deletions src/Ninject.MockingKernel.SilverlightTests/App.xaml.cs
Expand Up @@ -19,10 +19,8 @@
namespace Ninject.Extensions.MockingKernel
{
using System;
using System.Reflection;
using System.Windows;
#if SILVERLIGHT_MSTEST
using Microsoft.Silverlight.Testing;
#endif

/// <summary>
/// The main class of the unittests.
Expand Down Expand Up @@ -67,9 +65,7 @@ public void CustomInitializeComponent()
/// <param name="e">The <see cref="System.Windows.StartupEventArgs"/> instance containing the event data.</param>
private void Application_Startup(object sender, StartupEventArgs e)
{
#if SILVERLIGHT_MSTEST
RootVisual = UnitTestSystem.CreateTestPage();
#endif
RootVisual = new Xunit.Runner.Silverlight.TestEngine(Assembly.GetExecutingAssembly());
}

/// <summary>
Expand Down
68 changes: 0 additions & 68 deletions src/Ninject.MockingKernel.SilverlightTests/AssertWithThrows.cs

This file was deleted.

0 comments on commit 4ab2f2a

Please sign in to comment.