using System.Collections.Generic; using System.Linq; using FizzWare.NBuilder; using NzbDrone.Core.Datastore; namespace NzbDrone.Core.Test.Framework { public static class NBuilderExtensions { public static T BuildNew(this ISingleObjectBuilder builder) where T : ModelBase, new() { return builder.With(c => c.Id = 0).Build(); } public static List BuildList(this IListBuilder builder) where T : ModelBase, new() { return builder.Build().ToList(); } public static List BuildListOfNew(this IListBuilder builder) where T : ModelBase, new() { return BuildList(builder.All().With(c => c.Id = 0)); } } }