forked from SolrNet/SolrNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved SolrNet integration tests to separate project.
Moved integration tests for each IOC component into their own classes. Consistent naming of test fixtures.
- Loading branch information
Stephen Pope
committed
Dec 26, 2012
1 parent
27ccc49
commit 25f6dc5
Showing
25 changed files
with
776 additions
and
565 deletions.
There are no files selected for viewing
159 changes: 80 additions & 79 deletions
159
AutofacContrib.SolrNet.Tests/AutofacContrib.SolrNet.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,87 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{77E47E7C-2CEE-406A-B344-9699DA0F1851}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>AutofacContrib.SolrNet.Tests</RootNamespace> | ||
<AssemblyName>AutofacContrib.SolrNet.Tests</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup Condition="$(TargetFrameworkVersion)=='v4.0'"> | ||
<Reference Include="Autofac"> | ||
<HintPath>..\lib\NET-4.0\Autofac.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup Condition="$(TargetFrameworkVersion)!='v4.0'"> | ||
<Reference Include="Autofac"> | ||
<HintPath>..\lib\Autofac.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="Gallio, Version=3.3.0.0, Culture=neutral, PublicKeyToken=eb9cfa67ee6ab36e, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\lib\Gallio.dll</HintPath> | ||
</Reference> | ||
<Reference Include="MbUnit, Version=3.3.0.0, Culture=neutral, PublicKeyToken=eb9cfa67ee6ab36e, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\lib\MbUnit.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.configuration" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="AutofacMulticoreTests.cs" /> | ||
<Compile Include="AutofacTests.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\AutofacContrib.SolrNet\AutofacContrib.SolrNet.csproj"> | ||
<Project>{931CEB14-556F-4893-A8D9-C7C6DACA444F}</Project> | ||
<Name>AutofacContrib.SolrNet</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\SolrNet.Tests\SolrNet.Tests.csproj"> | ||
<Project>{F3FE6EF5-CF5C-4461-8691-4A498A463FD5}</Project> | ||
<Name>SolrNet.Tests</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\SolrNet\SolrNet.csproj"> | ||
<Project>{CEEB8690-3E08-4440-B647-787A58E71CFA}</Project> | ||
<Name>SolrNet</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{77E47E7C-2CEE-406A-B344-9699DA0F1851}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>AutofacContrib.SolrNet.Tests</RootNamespace> | ||
<AssemblyName>AutofacContrib.SolrNet.Tests</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup Condition="$(TargetFrameworkVersion)=='v4.0'"> | ||
<Reference Include="Autofac"> | ||
<HintPath>..\lib\NET-4.0\Autofac.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup Condition="$(TargetFrameworkVersion)!='v4.0'"> | ||
<Reference Include="Autofac"> | ||
<HintPath>..\lib\Autofac.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="Gallio, Version=3.3.0.0, Culture=neutral, PublicKeyToken=eb9cfa67ee6ab36e, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\lib\Gallio.dll</HintPath> | ||
</Reference> | ||
<Reference Include="MbUnit, Version=3.3.0.0, Culture=neutral, PublicKeyToken=eb9cfa67ee6ab36e, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\lib\MbUnit.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.configuration" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="AutofacIntegrationFixture.cs" /> | ||
<Compile Include="AutofacMulticoreFixture.cs" /> | ||
<Compile Include="AutofacFixture.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\AutofacContrib.SolrNet\AutofacContrib.SolrNet.csproj"> | ||
<Project>{931CEB14-556F-4893-A8D9-C7C6DACA444F}</Project> | ||
<Name>AutofacContrib.SolrNet</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\SolrNet.Tests\SolrNet.Tests.csproj"> | ||
<Project>{F3FE6EF5-CF5C-4461-8691-4A498A463FD5}</Project> | ||
<Name>SolrNet.Tests</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\SolrNet\SolrNet.csproj"> | ||
<Project>{CEEB8690-3E08-4440-B647-787A58E71CFA}</Project> | ||
<Name>SolrNet</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Autofac; | ||
using MbUnit.Framework; | ||
using SolrNet; | ||
|
||
namespace AutofacContrib.SolrNet.Tests { | ||
[TestFixture] | ||
[Category("Integration")] | ||
public class AutofacIntegrationFixture { | ||
[Test] | ||
public void Ping_And_Query() | ||
{ | ||
var builder = new ContainerBuilder(); | ||
builder.RegisterModule(new SolrNetModule("http://localhost:8983/solr")); | ||
var container = builder.Build(); | ||
var solr = container.Resolve<ISolrOperations<AutofacFixture.Entity>>(); | ||
solr.Ping(); | ||
Console.WriteLine(solr.Query(SolrQuery.All).Count); | ||
} | ||
|
||
[Test] | ||
public void DictionaryDocument() | ||
{ | ||
var builder = new ContainerBuilder(); | ||
builder.RegisterModule(new SolrNetModule("http://localhost:8983/solr")); | ||
var container = builder.Build(); | ||
var solr = container.Resolve<ISolrOperations<Dictionary<string, object>>>(); | ||
var results = solr.Query(SolrQuery.All); | ||
Assert.GreaterThan(results.Count, 0); | ||
foreach (var d in results) | ||
{ | ||
Assert.GreaterThan(d.Count, 0); | ||
foreach (var kv in d) | ||
Console.WriteLine("{0}: {1}", kv.Key, kv.Value); | ||
} | ||
} | ||
|
||
[Test] | ||
public void DictionaryDocument_add() | ||
{ | ||
var builder = new ContainerBuilder(); | ||
builder.RegisterModule(new SolrNetModule("http://localhost:8983/solr")); | ||
var container = builder.Build(); | ||
var solr = container.Resolve<ISolrOperations<Dictionary<string, object>>>(); | ||
solr.Add(new Dictionary<string, object> { | ||
{"id", "ababa"}, | ||
{"manu", "who knows"}, | ||
{"popularity", 55}, | ||
{"timestamp", DateTime.UtcNow}, | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.