Skip to content

Commit 599db8a

Browse files
author
Ethan Hann
committed
Replace VS test project with regular lib project
* Xamarin does not understand VS test projects.
1 parent 6d485e1 commit 599db8a

File tree

10 files changed

+145
-437
lines changed

10 files changed

+145
-437
lines changed

IntegrationEngine.Core/Storage/ESRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public T SelectById(object id)
3434
return item;
3535
}
3636

37-
public T Insert(T value)
37+
public virtual T Insert(T value)
3838
{
3939
var document = SelectById(ElasticClient.Index<T>(value).Id);
4040
return document;

IntegrationEngine.Tests/Api/Controllers/CronTriggerControllerTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ public void ShouldScheduleJobWhenCronTriggerIsCreated()
2929
subject.PostIntegrationJob(expected);
3030

3131
engineScheduler.Verify(x => x
32-
.ScheduleJobWithCronTrigger(It.Is<CronTrigger>(y => y.JobType == jobType &&
33-
y.CronExpressionString == cronExpression)),
34-
Times.Once);
32+
.ScheduleJobWithCronTrigger(It.Is<CronTrigger>(y => y.JobType == jobType &&
33+
y.CronExpressionString == cronExpression)), Times.Once);
3534
}
3635
}
3736
}

IntegrationEngine.Tests/EngineHostConfigurationTest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using NUnit.Framework;
1+
using IntegrationEngine.Configuration;
2+
using Microsoft.Practices.Unity;
3+
using Moq;
4+
using NUnit.Framework;
25
using System;
36

47
namespace IntegrationEngine.Tests
@@ -9,7 +12,9 @@ public class EngineHostConfigurationTest
912
public void CanLoadConfiguration()
1013
{
1114
var subject = new EngineHostConfiguration();
12-
15+
var container = new Mock<StubContainer>();
16+
subject.Container = container.Object;
17+
1318
subject.LoadConfiguration();
1419

1520
Assert.IsNotNull(subject.Configuration);

IntegrationEngine.Tests/IntegrationEngine.Tests.csproj

Lines changed: 36 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
34
<PropertyGroup>
45
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
56
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProjectGuid>{820C4703-46CF-4C65-AB32-961170D96E46}</ProjectGuid>
7+
<ProjectGuid>{E4B53AFA-BF0F-47DB-B765-100F8B60BA40}</ProjectGuid>
78
<OutputType>Library</OutputType>
89
<AppDesignerFolder>Properties</AppDesignerFolder>
910
<RootNamespace>IntegrationEngine.Tests</RootNamespace>
1011
<AssemblyName>IntegrationEngine.Tests</AssemblyName>
1112
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1213
<FileAlignment>512</FileAlignment>
13-
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14-
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
15-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
16-
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
17-
<IsCodedUITest>False</IsCodedUITest>
18-
<TestProjectType>UnitTest</TestProjectType>
1914
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
2015
<RestorePackages>true</RestorePackages>
16+
<TargetFrameworkProfile />
2117
</PropertyGroup>
2218
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2319
<DebugSymbols>true</DebugSymbols>
@@ -27,7 +23,8 @@
2723
<DefineConstants>DEBUG;TRACE</DefineConstants>
2824
<ErrorReport>prompt</ErrorReport>
2925
<WarningLevel>4</WarningLevel>
30-
<PlatformTarget>x86</PlatformTarget>
26+
<Prefer32Bit>false</Prefer32Bit>
27+
<PlatformTarget>AnyCPU</PlatformTarget>
3128
</PropertyGroup>
3229
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3330
<DebugType>pdbonly</DebugType>
@@ -36,31 +33,35 @@
3633
<DefineConstants>TRACE</DefineConstants>
3734
<ErrorReport>prompt</ErrorReport>
3835
<WarningLevel>4</WarningLevel>
36+
<Prefer32Bit>false</Prefer32Bit>
3937
</PropertyGroup>
4038
<ItemGroup>
41-
<Reference Include="Common.Logging, Version=2.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
42-
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\packages\Common.Logging.2.3.1\lib\net40\Common.Logging.dll</HintPath>
39+
<Reference Include="fx.configuration">
40+
<HintPath>..\packages\fx.configuration.0.4.0\lib\net45\fx.configuration.dll</HintPath>
4441
</Reference>
45-
<Reference Include="fx.configuration, Version=0.4.0.0, Culture=neutral, PublicKeyToken=d6b5ff1ed8812a28, processorArchitecture=MSIL">
42+
<Reference Include="Microsoft.Practices.Unity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4643
<SpecificVersion>False</SpecificVersion>
47-
<HintPath>..\packages\fx.configuration.0.4.0\lib\net45\fx.configuration.dll</HintPath>
44+
<HintPath>..\packages\Unity.3.5.1404.0\lib\net45\Microsoft.Practices.Unity.dll</HintPath>
45+
</Reference>
46+
<Reference Include="Microsoft.Practices.Unity.Configuration">
47+
<HintPath>..\packages\Unity.3.5.1404.0\lib\net45\Microsoft.Practices.Unity.Configuration.dll</HintPath>
48+
</Reference>
49+
<Reference Include="Microsoft.Practices.Unity.RegistrationByConvention">
50+
<HintPath>..\packages\Unity.3.5.1404.0\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll</HintPath>
4851
</Reference>
4952
<Reference Include="Moq">
5053
<HintPath>..\packages\Moq.4.2.1409.1722\lib\net40\Moq.dll</HintPath>
5154
</Reference>
5255
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
5356
<SpecificVersion>False</SpecificVersion>
54-
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
55-
</Reference>
56-
<Reference Include="nunit.framework">
57-
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
57+
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
5858
</Reference>
59-
<Reference Include="Quartz, Version=2.3.0.18, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
59+
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
6060
<SpecificVersion>False</SpecificVersion>
61-
<HintPath>..\packages\Quartz.2.3\lib\net40\Quartz.dll</HintPath>
61+
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
6262
</Reference>
6363
<Reference Include="System" />
64+
<Reference Include="System.Core" />
6465
<Reference Include="System.Net.Http" />
6566
<Reference Include="System.Net.Http.Formatting, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6667
<SpecificVersion>False</SpecificVersion>
@@ -70,31 +71,29 @@
7071
<SpecificVersion>False</SpecificVersion>
7172
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.2\lib\net45\System.Web.Http.dll</HintPath>
7273
</Reference>
74+
<Reference Include="System.Xml.Linq" />
75+
<Reference Include="System.Data.DataSetExtensions" />
76+
<Reference Include="Microsoft.CSharp" />
77+
<Reference Include="System.Data" />
78+
<Reference Include="System.Xml" />
7379
</ItemGroup>
74-
<Choose>
75-
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
76-
<ItemGroup>
77-
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
78-
</ItemGroup>
79-
</When>
80-
<Otherwise />
81-
</Choose>
8280
<ItemGroup>
8381
<Compile Include="Api\Controllers\CronTriggerControllerTest.cs" />
84-
<Compile Include="Properties\AssemblyInfo.cs" />
8582
<Compile Include="EngineHostConfigurationTest.cs" />
83+
<Compile Include="Properties\AssemblyInfo.cs" />
84+
<Compile Include="StubContainer.cs" />
8685
</ItemGroup>
8786
<ItemGroup>
8887
<None Include="..\configuration\IntegrationEngine.json">
8988
<Link>IntegrationEngine.json</Link>
9089
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
9190
</None>
9291
<None Include="app.config" />
93-
<None Include="job_scheduling_data_2_0.xsd">
94-
<SubType>Designer</SubType>
95-
</None>
9692
<None Include="packages.config" />
9793
</ItemGroup>
94+
<ItemGroup>
95+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
96+
</ItemGroup>
9897
<ItemGroup>
9998
<ProjectReference Include="..\IntegrationEngine.Core\IntegrationEngine.Core.csproj">
10099
<Project>{3f3794d7-4078-4d26-954c-7864173edd86}</Project>
@@ -109,27 +108,14 @@
109108
<Name>IntegrationEngine</Name>
110109
</ProjectReference>
111110
</ItemGroup>
112-
<Choose>
113-
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
114-
<ItemGroup>
115-
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
116-
<Private>False</Private>
117-
</Reference>
118-
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
119-
<Private>False</Private>
120-
</Reference>
121-
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
122-
<Private>False</Private>
123-
</Reference>
124-
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
125-
<Private>False</Private>
126-
</Reference>
127-
</ItemGroup>
128-
</When>
129-
</Choose>
130-
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
131111
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
132112
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
113+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
114+
<PropertyGroup>
115+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
116+
</PropertyGroup>
117+
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
118+
</Target>
133119
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
134120
Other similar extension points exist, see Microsoft.Common.targets.
135121
<Target Name="BeforeBuild">

IntegrationEngine.Tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
[assembly: AssemblyTitle("IntegrationEngine.Tests")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("Hewlett-Packard Company")]
11+
[assembly: AssemblyCompany("")]
1212
[assembly: AssemblyProduct("IntegrationEngine.Tests")]
13-
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")]
13+
[assembly: AssemblyCopyright("Copyright © 2015")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -20,7 +20,7 @@
2020
[assembly: ComVisible(false)]
2121

2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
23-
[assembly: Guid("becd6ea6-e584-4e2c-8da2-a02b77513c22")]
23+
[assembly: Guid("6bbf7ff0-4d22-462b-bb56-c4c7e2140cee")]
2424

2525
// Version information for an assembly consists of the following four values:
2626
//
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using Microsoft.Practices.Unity;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace IntegrationEngine.Tests
9+
{
10+
public class StubContainer : IUnityContainer
11+
{
12+
public IUnityContainer AddExtension(UnityContainerExtension extension)
13+
{
14+
throw new NotImplementedException();
15+
}
16+
17+
public object BuildUp(Type t, object existing, string name, params ResolverOverride[] resolverOverrides)
18+
{
19+
throw new NotImplementedException();
20+
}
21+
22+
public object Configure(Type configurationInterface)
23+
{
24+
throw new NotImplementedException();
25+
}
26+
27+
public IUnityContainer CreateChildContainer()
28+
{
29+
throw new NotImplementedException();
30+
}
31+
32+
public IUnityContainer Parent
33+
{
34+
get { throw new NotImplementedException(); }
35+
}
36+
37+
public IUnityContainer RegisterInstance(Type t, string name, object instance, LifetimeManager lifetime)
38+
{
39+
throw new NotImplementedException();
40+
}
41+
42+
public virtual IUnityContainer RegisterInstance<TInterface>(TInterface instance)
43+
{
44+
return this;
45+
}
46+
47+
public IUnityContainer RegisterType(Type from, Type to, string name, LifetimeManager lifetimeManager, params InjectionMember[] injectionMembers)
48+
{
49+
throw new NotImplementedException();
50+
}
51+
52+
public IEnumerable<ContainerRegistration> Registrations
53+
{
54+
get { throw new NotImplementedException(); }
55+
}
56+
57+
public IUnityContainer RemoveAllExtensions()
58+
{
59+
throw new NotImplementedException();
60+
}
61+
62+
public object Resolve(Type t, string name, params ResolverOverride[] resolverOverrides)
63+
{
64+
throw new NotImplementedException();
65+
}
66+
67+
public IEnumerable<object> ResolveAll(Type t, params ResolverOverride[] resolverOverrides)
68+
{
69+
throw new NotImplementedException();
70+
}
71+
72+
public void Teardown(object o)
73+
{
74+
throw new NotImplementedException();
75+
}
76+
77+
public void Dispose()
78+
{
79+
throw new NotImplementedException();
80+
}
81+
}
82+
}

0 commit comments

Comments
 (0)