Skip to content

Commit

Permalink
Changed Silverlight unit tests to use xUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
remogloor committed Apr 17, 2011
1 parent 85af1e7 commit 135b152
Show file tree
Hide file tree
Showing 108 changed files with 1,620 additions and 2,891 deletions.
24 changes: 22 additions & 2 deletions Ninject with Silverlight and WP7 Unittesting.sln
Expand Up @@ -19,6 +19,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ninject.Tests", "src\Ninjec
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ninject.WindowsPhone7Tests", "src\Ninject.WindowsPhone7Tests\Ninject.WindowsPhone7Tests.csproj", "{F7314647-1C1F-4960-A693-AA773C54C13D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestAssembly", "src\TestAssembly\TestAssembly.csproj", "{C9F6CFE7-44B2-4D55-9307-33C34C045468}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestModules", "src\TestModules\TestModules.csproj", "{90F46524-0716-4180-8A5F-1CD1EB5686F6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
AutomatedRelease|Any CPU = AutomatedRelease|Any CPU
Expand Down Expand Up @@ -53,8 +57,8 @@ Global
{033B09D3-8532-419A-B906-36F8EB605B30}.Release|Any CPU.Build.0 = Release|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.AutomatedRelease|Any CPU.ActiveCfg = AutomatedRelease|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.AutomatedRelease|Any CPU.Build.0 = AutomatedRelease|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.Debug .NET 4.0|Any CPU.ActiveCfg = Debug .NET 4.0|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.Debug .NET 4.0|Any CPU.Build.0 = Debug .NET 4.0|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.Debug .NET 4.0|Any CPU.ActiveCfg = Debug|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.Debug .NET 4.0|Any CPU.Build.0 = Debug|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E7DE343-8DBD-42EE-94ED-036E9E0F5411}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -71,6 +75,22 @@ Global
{F7314647-1C1F-4960-A693-AA773C54C13D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7314647-1C1F-4960-A693-AA773C54C13D}.Release|Any CPU.Build.0 = Release|Any CPU
{F7314647-1C1F-4960-A693-AA773C54C13D}.Release|Any CPU.Deploy.0 = Release|Any CPU
{C9F6CFE7-44B2-4D55-9307-33C34C045468}.AutomatedRelease|Any CPU.ActiveCfg = AutomatedRelease|Any CPU
{C9F6CFE7-44B2-4D55-9307-33C34C045468}.AutomatedRelease|Any CPU.Build.0 = AutomatedRelease|Any CPU
{C9F6CFE7-44B2-4D55-9307-33C34C045468}.Debug .NET 4.0|Any CPU.ActiveCfg = Debug|Any CPU
{C9F6CFE7-44B2-4D55-9307-33C34C045468}.Debug .NET 4.0|Any CPU.Build.0 = Debug|Any CPU
{C9F6CFE7-44B2-4D55-9307-33C34C045468}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9F6CFE7-44B2-4D55-9307-33C34C045468}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9F6CFE7-44B2-4D55-9307-33C34C045468}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9F6CFE7-44B2-4D55-9307-33C34C045468}.Release|Any CPU.Build.0 = Release|Any CPU
{90F46524-0716-4180-8A5F-1CD1EB5686F6}.AutomatedRelease|Any CPU.ActiveCfg = AutomatedRelease|Any CPU
{90F46524-0716-4180-8A5F-1CD1EB5686F6}.AutomatedRelease|Any CPU.Build.0 = AutomatedRelease|Any CPU
{90F46524-0716-4180-8A5F-1CD1EB5686F6}.Debug .NET 4.0|Any CPU.ActiveCfg = Debug|Any CPU
{90F46524-0716-4180-8A5F-1CD1EB5686F6}.Debug .NET 4.0|Any CPU.Build.0 = Debug|Any CPU
{90F46524-0716-4180-8A5F-1CD1EB5686F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90F46524-0716-4180-8A5F-1CD1EB5686F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90F46524-0716-4180-8A5F-1CD1EB5686F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90F46524-0716-4180-8A5F-1CD1EB5686F6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
17 changes: 10 additions & 7 deletions Ninject.build
Expand Up @@ -94,7 +94,6 @@
<copy todir="${current.path.test}">
<fileset basedir="${path.tools.xunit}">
<include name="xunit.dll"/>
<include name="xunit.should.dll"/>
</fileset>
</copy>
<copy todir="${current.path.test}" if="${not(string::contains(build.platform, 'net-4.0'))}">
Expand Down Expand Up @@ -125,7 +124,6 @@
<include name="Moq.dll"/>
<include name="xunit.dll"/>
<include name="System.Web.dll"/>
<include name="xunit.should.dll"/>
<include name="${product.assembly}"/>
</references>
<nowarn>
Expand Down Expand Up @@ -155,15 +153,16 @@
</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}"
output="${current.path.test}/${product.assembly.silverlighttestdll}">
<sources basedir="${path.src}">
<include name="${product.name}.Test/*.cs"/>
<include name="${product.name}.Test/Fakes/**/*.cs"/>
<include name="${product.name}.Test/Unit/**/*.cs"/>
<include name="${product.name}.Test/Integration/**/*.cs"/>
<include name="${product.name}.SilverlightTests/*.cs"/>
<exclude name="${product.name}.Test/MSTestAttributes/*.cs"/>
Expand All @@ -175,11 +174,14 @@
<include name="System.Windows.dll"/>
<include name="System.Windows.Browser.dll"/>
<include name="System.Net.dll"/>
<include name="Moq.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="${product.assembly}"/>
</references>
<nowarn>
Expand All @@ -189,6 +191,7 @@
<zip zipfile="${current.path.test}/${product.assembly.silverlighttest}">
<fileset basedir="${current.path.test}">
<include name="*.dll" />
<exclude name="CommonServiceLocator.NinjectAdapter.dll" />
</fileset>
<fileset basedir="${path.src}/${product.name}.SilverlightTests">
<include name="AppManifest.xaml" if="${string::contains(build.platform, 'silverlight-4.0')}"/>
Expand Down
8 changes: 4 additions & 4 deletions Ninject.include
Expand Up @@ -9,13 +9,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 Down Expand Up @@ -246,7 +246,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.add" value="false"/>
</target>

Expand Down Expand Up @@ -276,8 +276,8 @@
</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')}">
<exec program="${path.tools.statlight}" workingdir="${current.path.test}" commandline='-x"${product.assembly.silverlighttest}" --teamcity' failonerror="true"/>
</target>

<target name="UnzipDependencies">
Expand Down
Binary file removed lib/System.Web.Abstractions.dll
Binary file not shown.
Binary file removed lib/System.Web.Mvc.dll
Binary file not shown.
Binary file removed lib/System.Web.Routing.dll
Binary file not shown.
8 changes: 2 additions & 6 deletions src/Ninject.SilverlightTests/App.xaml.cs
Expand Up @@ -20,10 +20,8 @@
namespace Ninject
{
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 @@ -68,9 +66,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
10 changes: 7 additions & 3 deletions src/Ninject.SilverlightTests/AppManifest.xaml
@@ -1,9 +1,13 @@
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="Ninject.SilverlightTests" EntryPointType="Ninject.SilverlightTests.App" RuntimeVersion="4.0.50401.0">
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="Ninject.SilverlightTests" EntryPointType="Ninject.App" RuntimeVersion="4.0.50826.0">
<Deployment.Parts>
<AssemblyPart x:Name="Ninject.SilverlightTests" Source="Ninject.SilverlightTests.dll" />
<AssemblyPart x:Name="Ninject" Source="Ninject.dll" />
<AssemblyPart x:Name="UnitDrivenLight" Source="UnitDrivenLight.dll" />
<AssemblyPart x:Name="Moq.Silverlight" Source="Moq.Silverlight.dll" />
<AssemblyPart x:Name="Ninject" Source="Ninject.dll" />
<AssemblyPart x:Name="xunit-silverlight" Source="xunit-silverlight.dll" />
<AssemblyPart x:Name="xunit.extensions-silverlight" Source="xunit.extensions-silverlight.dll" />
<AssemblyPart x:Name="xunit.runner.silverlight" Source="xunit.runner.silverlight.dll" />
<AssemblyPart x:Name="Castle.Core" Source="Castle.Core.dll" />
<AssemblyPart x:Name="System.Xml.Linq" Source="System.Xml.Linq.dll" />
<AssemblyPart x:Name="Microsoft.CSharp" Source="Microsoft.CSharp.dll" />
</Deployment.Parts>
</Deployment>
73 changes: 0 additions & 73 deletions src/Ninject.SilverlightTests/AssertWithThrows.cs

This file was deleted.

0 comments on commit 135b152

Please sign in to comment.