mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
fixed few more broken tests.
This commit is contained in:
parent
eaff6dc18f
commit
2008b54f5d
12 changed files with 64 additions and 105 deletions
26
NzbDrone.Test.Common/NBuilderExtensions.cs
Normal file
26
NzbDrone.Test.Common/NBuilderExtensions.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FizzWare.NBuilder;
|
||||
using NzbDrone.Core.Datastore;
|
||||
|
||||
namespace NzbDrone.Test.Common
|
||||
{
|
||||
public static class NBuilderExtensions
|
||||
{
|
||||
public static T BuildNew<T>(this ISingleObjectBuilder<T> builder) where T : ModelBase, new()
|
||||
{
|
||||
return builder.With(c => c.Id = 0).Build();
|
||||
}
|
||||
|
||||
public static List<T> BuildList<T>(this IOperable<T> builder) where T : ModelBase, new()
|
||||
{
|
||||
return builder.Build().ToList();
|
||||
}
|
||||
|
||||
public static List<T> BuildListOfNew<T>(this IOperable<T> builder) where T : ModelBase, new()
|
||||
{
|
||||
return BuildList<T>(builder.All().With(c => c.Id = 0));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -53,6 +53,9 @@
|
|||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FizzWare.NBuilder">
|
||||
<HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation">
|
||||
<HintPath>..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -89,6 +92,7 @@
|
|||
<Compile Include="ExceptionVerification.cs" />
|
||||
<Compile Include="LoggingTest.cs" />
|
||||
<Compile Include="MockerExtensions.cs" />
|
||||
<Compile Include="NBuilderExtensions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ReflectionExtensions.cs" />
|
||||
<Compile Include="TestBase.cs" />
|
||||
|
@ -104,6 +108,10 @@
|
|||
<Project>{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}</Project>
|
||||
<Name>NzbDrone.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\NzbDrone.Core\NzbDrone.Core.csproj">
|
||||
<Project>{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}</Project>
|
||||
<Name>NzbDrone.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<packages>
|
||||
<package id="CommonServiceLocator" version="1.0" />
|
||||
<package id="Moq" version="4.0.10827" />
|
||||
<package id="NBuilder" version="3.0.1.1" targetFramework="net40" />
|
||||
<package id="NLog" version="2.0.0.2000" />
|
||||
<package id="NUnit" version="2.6.2" targetFramework="net40" />
|
||||
<package id="Unity" version="2.1.505.2" targetFramework="net40" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue