mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue