Skip to content

Commit

Permalink
Updated Statlight and added Windows Phone Unit test execution to the …
Browse files Browse the repository at this point in the history
…build process
  • Loading branch information
remogloor committed Jan 26, 2012
1 parent 022452f commit 8f90297
Show file tree
Hide file tree
Showing 32 changed files with 53 additions and 27 deletions.
3 changes: 3 additions & 0 deletions Ninject.build
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
<fileset basedir="${path.src}/${product.name}.SilverlightTests/Silverlight3"> <fileset basedir="${path.src}/${product.name}.SilverlightTests/Silverlight3">
<include name="AppManifest.xaml" unless="${string::contains(build.platform, 'silverlight-4.0')}"/> <include name="AppManifest.xaml" unless="${string::contains(build.platform, 'silverlight-4.0')}"/>
</fileset> </fileset>
<fileset basedir="${path.lib}">
<include name="System.Linq.dll" if="${string::contains(build.platform, 'wp7') and not(string::contains(build.platform, 'wp71'))}"/>
</fileset>
</zip> </zip>
</target> </target>
</project> </project>
5 changes: 3 additions & 2 deletions Ninject.include
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -366,10 +366,11 @@
</if> </if>
</target> </target>


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


<target name="UnzipDependencies"> <target name="UnzipDependencies">
Expand Down
31 changes: 6 additions & 25 deletions src/Ninject.Test/Integration/StandardKernelTests.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -434,34 +434,15 @@ public void RemovesAllBindingsForServiceAndReplacesWithSpecifiedBinding()
public class sdf : StandardKernelContext public class sdf : StandardKernelContext
{ {
[Fact] [Fact]
public void RemovesAllBindingsForServiceAndReplacesWithSpecifiedBinding() public void Ddd()
{
kernel.Bind<IWeapon>().To<Shuriken>().When(r => r.ParentRequest.Service.GetGenericArguments()[0] == typeof(string));
kernel.Bind<IWeapon>().To<Sword>().When(r => r.ParentRequest.Service.GetGenericArguments()[0] == typeof(int));
kernel.Bind(typeof(IRepository<>)).To(typeof(Repository<>));

var repo = kernel.Get<IRepository<int>>();

repo.Weapon.Should().BeOfType<Sword>();
}

public interface IRepository<T>
{ {
IWeapon Weapon { get; } this.kernel.Bind<IWeapon>().To<Sword>();
} this.kernel.Bind<IWarrior>().To<Ninja>();

this.kernel.Bind<IWarrior>().To<Samurai>().When(c => true);
public class Repository<T> : IRepository<T> this.kernel.GetAll<IWarrior>().Count().Should().Be(2);
{
public Repository(IWeapon weapon)
{
this.Weapon = weapon;
}

public IWeapon Weapon { get; private set; }
} }
} }



public class WhenCanResolveIsCalled : StandardKernelContext public class WhenCanResolveIsCalled : StandardKernelContext
{ {
[Fact] [Fact]
Expand Down
Binary file modified tools/statlight/Ionic.Zip.Reduced.dll
Binary file not shown.
Binary file added tools/statlight/Ninject.WindowsPhone7Tests.xap
Binary file not shown.
Binary file removed tools/statlight/StatLight.Client.For.April2010.xap
Binary file not shown.
Binary file removed tools/statlight/StatLight.Client.For.Feb2011.xap
Binary file not shown.
Binary file removed tools/statlight/StatLight.Client.For.July2009.xap
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tools/statlight/StatLight.Client.For.March2010.xap
Binary file not shown.
Binary file removed tools/statlight/StatLight.Client.For.May2010.xap
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tools/statlight/StatLight.Core.dll
Binary file not shown.
Binary file not shown.
Binary file modified tools/statlight/StatLight.exe
Binary file not shown.
41 changes: 41 additions & 0 deletions tools/statlight/StatLight.exe.config
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="StatLight.Core.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>

<!-- NOTE: the ConsoleColor{Name} settings are from the System.ConsoleColor enum (you can change these to any value in there)-->
<StatLight.Core.Properties.Settings>
<setting name="ConsoleColorError" serializeAs="String">
<value>Red</value>
</setting>
<setting name="ConsoleColorInformation" serializeAs="String">
<value>White</value>
</setting>
<setting name="ConsoleColorDebug" serializeAs="String">
<value>Cyan</value>
</setting>
<setting name="ConsoleColorWarning" serializeAs="String">
<value>Yellow</value>
</setting>
<setting name="ConsoleColorSuccess" serializeAs="String">
<value>Green</value>
</setting>

<!--
Windowless value will be used to set the silverlight object tag in the test page html. EX if the
windowless property is 'false' then it will output <param name="windowless" value="false"/> in the html
-->
<setting name="Windowless" serializeAs="String">
<value>false</value>
</setting>

</StatLight.Core.Properties.Settings>
</applicationSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

0 comments on commit 8f90297

Please sign in to comment.