Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed silverlight unittest runner problems.

  • Loading branch information...
commit 494cb48b03f63cd9ba586b2557a56785b747d9ec 1 parent 72e2537
jayt authored
View
3  ImpromptuInterface.MVVM.Silverlight5/ImpromptuInterface.MVVM (Silverlight5).csproj
@@ -17,6 +17,8 @@
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<!-- This property group is only here to support building this project using the
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
@@ -156,6 +158,7 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
3  ImpromptuInterface.Silverlight5/ImpromptuInterface (Silverlight5).csproj
@@ -17,6 +17,8 @@
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<!-- This property group is only here to support building this project using the
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
@@ -226,6 +228,7 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
3  Tests/UnitTestImpromptuInterface.Clay/UnitTestImpromptuInterface.Clay.csproj
@@ -12,6 +12,8 @@
<AssemblyName>UnitTestImpromptuInterface.Clay</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -91,6 +93,7 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
3  Tests/UnitTestImpromptuInterface.SelfRunner/UnitTestImpromptuInterface.SelfRunner.csproj
@@ -11,6 +11,8 @@
<AssemblyName>UnitTestImpromptuInterface.SelfRunner</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<StartupObject>UnitTestImpromptuInterface.Program</StartupObject>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -120,4 +122,5 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
View
3  Tests/UnitTestImpromptuInterface.VBNet/UnitTestImpromptuInterface.VBNET.vbproj
@@ -25,6 +25,8 @@
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -138,4 +140,5 @@
<Folder Include="My Project\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
View
4 Tests/UnitTestImpromptuInterface/ImpromptuDynamic.cs
@@ -590,9 +590,7 @@ public void TestLateLibrarybind()
if (tBigIntType.IsAvailable)
{
-#if SILVERLIGHT
- Assert.Fail();
-#endif
+
var one = tBigIntType.@new(1);
var two = tBigIntType.@new(2);
View
5 Tests/UnitTestImpromptuInterface/TinyIoCTest.cs
@@ -1,5 +1,6 @@
using System;
using ImpromptuInterface.MVVM.TinyIoC;
+
using TinyIoC;
#if !SELFRUNNER
@@ -7,8 +8,10 @@
#endif
using ImpromptuInterface.MVVM;
+using Assert = NUnit.Framework.Assert;
#if SILVERLIGHT
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestImpromptuInterface.Silverlight
#else
namespace UnitTestImpromptuInterface
@@ -68,7 +71,7 @@ public void Get_Many()
}
}
- [Test, ExpectedException(typeof(NotSupportedException), ExpectedMessage = "TinyIoC does not support this operation!")]
+ [Test, ExpectedException(typeof(NotSupportedException))]
public void Get_Many_Dynamic()
{
var tinyContainer = new TinyIoCContainer();
View
3  Tests/UnitTestImpromptuInterface/UnitTestImpromptuInterface.csproj
@@ -25,6 +25,8 @@
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -159,4 +161,5 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
View
3  Tests/UnitTestImpromptuInterface/UnityTest.cs
@@ -5,13 +5,16 @@
using Microsoft.Practices.Unity;
#if !SELFRUNNER
+
using NUnit.Framework;
#endif
using ImpromptuInterface.MVVM;
using ImpromptuInterface.MVVM.Unity;
+using Assert = NUnit.Framework.Assert;
#if SILVERLIGHT
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestImpromptuInterface.Silverlight
#else
namespace UnitTestImpromptuInterface
View
88 Tests/UnitTestImpromputInterface.Silverlight/Support/Helper.cs
@@ -9,6 +9,94 @@
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using NUnit.Framework;
+using Assert = NUnit.Framework.Assert;
+using MSTest =Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace NUnit.Framework
+{
+ public delegate void TestDelegate();
+
+
+ public class Assert
+ {
+ public static void Throws<T>(TestDelegate fun) where T:Exception
+ {
+ var run = false;
+ try
+ {
+ fun();
+ }
+ catch (Exception e)
+ {
+
+ run = e is T || e is MSTest.AssertFailedException && new AssertionException("Dummy") is T;
+ }
+
+ MSTest.Assert.IsTrue(run,"Did Not Catch " + typeof(T).Name);
+ }
+
+ public static void AreEqual(dynamic a, dynamic b)
+ {
+ MSTest.Assert.AreEqual(a,b);
+ }
+
+ public static void Fail()
+ {
+ MSTest.Assert.Fail();
+ }
+
+ public static void IsFalse(bool test)
+ {
+ MSTest.Assert.IsFalse(test);
+ }
+
+ public static void IsInstanceOf<T>(object obj)
+ {
+ MSTest.Assert.IsInstanceOfType(obj,typeof(T));
+ }
+
+ public static void IsNotNull(object obj)
+ {
+ MSTest.Assert.IsNotNull(obj);
+ }
+
+ public static void Less(dynamic a, dynamic b)
+ {
+ MSTest.Assert.IsTrue( a < b, String.Format("Expected {0} to be less than {1}",a,b));
+ }
+ }
+
+ public class AssertionException:MSTest.AssertFailedException
+ {
+ public AssertionException(string message) : base(message)
+ {
+ }
+
+ public AssertionException(string message, Exception inner) : base(message, inner)
+ {
+ }
+ }
+
+ public class TestFixtureSetUpAttribute : Attribute
+ {
+
+ }
+
+ public class SetUpAttribute : Attribute
+ {
+
+ }
+
+ public class TestFixtureAttribute:Attribute
+ {
+
+ }
+
+ public class TestAttribute : Attribute
+ {
+
+ }
+}
+
namespace UnitTestImpromptuInterface
{
View
36 Tests/UnitTestImpromputInterface.Silverlight/UnitTestImpromptuInterface.Silverlight.csproj
@@ -40,6 +40,8 @@
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<!-- This property group is only here to support building this project using the
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
@@ -72,19 +74,18 @@
<Reference Include="Castle.Core">
<HintPath>..\..\packages\Moq.4.0.10827\lib\Silverlight4\Castle.Core.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\..\..\..\..\..\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\Microsoft.CSharp.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.Practices.ServiceLocation">
<HintPath>..\..\packages\CommonServiceLocator.1.0\lib\SL30\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity.Silverlight">
<HintPath>..\..\packages\Unity.2.1.505.0\lib\SL30\Microsoft.Practices.Unity.Silverlight.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.Silverlight.Testing">
- <HintPath>..\..\tools\Silverlight4-NUnit2.5.8-Apr2010\Microsoft.Silverlight.Testing.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <HintPath>..\..\tools\Silverlight4-NUnit2.5.8-Apr2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
- </Reference>
+ <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Moq.Silverlight">
<HintPath>..\..\packages\Moq.4.0.10827\lib\Silverlight4\Moq.Silverlight.dll</HintPath>
</Reference>
@@ -92,17 +93,13 @@
<Reference Include="Ninject">
<HintPath>..\..\packages\Ninject.2.2.1.4\lib\sl4\Ninject.dll</HintPath>
</Reference>
- <Reference Include="NUnit.Silverlight.Compatibility">
- <HintPath>..\..\tools\Silverlight4-NUnit2.5.8-Apr2010\NUnit.Silverlight.Compatibility.dll</HintPath>
- </Reference>
- <Reference Include="NUnit.Silverlight.Framework">
- <HintPath>..\..\tools\Silverlight4-NUnit2.5.8-Apr2010\NUnit.Silverlight.Framework.dll</HintPath>
+ <Reference Include="System.ComponentModel.Composition, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\..\..\..\..\..\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.ComponentModel.Composition.dll</HintPath>
</Reference>
- <Reference Include="NUnit.Silverlight.Metadata">
- <HintPath>..\..\tools\Silverlight4-NUnit2.5.8-Apr2010\NUnit.Silverlight.Metadata.dll</HintPath>
+ <Reference Include="System.Windows">
+ <Private>True</Private>
</Reference>
- <Reference Include="System.ComponentModel.Composition, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Windows" />
<Reference Include="System.Core">
<Private>False</Private>
</Reference>
@@ -111,8 +108,12 @@
<Reference Include="System" />
<Reference Include="System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\..\..\..\..\..\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Xml.Linq.dll</HintPath>
</Reference>
- <Reference Include="System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\UnitTestImpromptuInterface\Basic.cs">
@@ -217,6 +218,7 @@
<Properties InternalTargetFrameworkVersion="SL2.0" />
</MonoDevelop>
</ProjectExtensions>
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
3  Tests/UnitTestSupportLibrary.Silverlight/UnitTestSupportLibrary.Silverlight.csproj
@@ -17,6 +17,8 @@
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<!-- This property group is only here to support building this project using the
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
@@ -68,6 +70,7 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
3  Tests/UnitTestSupportLibrary/UnitTestSupportLibrary.csproj
@@ -12,6 +12,8 @@
<AssemblyName>UnitTestSupportLibrary</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\impromptuinterface\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -45,6 +47,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
Please sign in to comment.
Something went wrong with that request. Please try again.