NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet · #1846 most downloaded on NuGet
Through a fluent, extensible interface, NBuilder allows you to rapidly create test data, automatically assigning values to properties and public fields that are one of the built in .NET data types (e.g. ints and strings). NBuilder allows you to override for properties you are interested in using lambda expressions.
Last release 7 years ago
no release in 18 months
Ships unpredictably
gaps range from 2 months to 5.0 years
Most releases are documented
notes for 6 of 10 stable releases
Nothing withdrawn
no release was ever pulled
16 years old
22 releases · first in 2011
Doug Murphy has added a couple of PR's to nbuilder.
Doug Murphy has added a couple of PR's to nbuilder.
Bug: Random generation of enums never includes the last enum value.
Feature: Add support for IPv6 addresses and MAC addresses to the GetRandom static class which is used to generate random, properly formatted values for specific property types.
Nothing published for this version
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Bug Guid.Empty being incremented. Solution was to disable NBuilder's property name for static or read-only fields. Thanks to Dominic Hemken for the PR
Guid.Empty being incremented. Solution was to disable NBuilder's property name for static or read-only fields. Thanks to Dominic Hemken for the PR.CreateListOfSize had undefined behavior when called from the static Builder and executed on multiple threads at the same time. While the future of NBulider will be to remove the static builder, it's a defect in the current implementation. Thanks to Ovidiu Rădoi for the PR.Nothing published for this version
Breaking Change: WithConstructor
WithConstructor
Expression<Func<T>>.Func<T>.[Obsolete] in favor of WithFactoryIndexOf as part of the ListBuilder implementation.var products = new Builder()
.CreateListOfSize<Product>(10)
.IndexOf(0, 2, 5)
.With(x => x.Title = "A special title")
.Build();
DateTimeKind to RandomGeneratorvar result = randomGenerator.Next(DateTime.MinValue, DateTime.MaxValue, DateTimeKind.Utc);
DisablePropertyNamingFor(PropertyInfo) overload to BuilderSettings.TheRest as an extension to the ListBuilder.var results = new Builder()
.CreateListOfSize<SimpleClass>(10)
.TheFirst(2)
.Do(row => row.String1 = "One")
.TheRest()
.Do(row => row.String1 = "Ten")
.Build()
;
TheLast multiple times for the same range.Nothing published for this version
Added support for disabling property naming via an interface:
In a multi tenant scenario, the db entities usually have a property that denotes that they are for that specific tenant:
public interface ITenantEntity
{
int TenantId {get; set;}
}
public class User: ITenantEntity
{
public int TenantId {get; set;}
...
}
public class Car: ITenantEntity
{
public int TenantId {get; set;}
...
}
When writing tests for the db layer, it is useful to disable the autoassignment for this property by just specifying an interface in BuilderSetup.DisablePropertyNamingFor.
Nothing published for this version
Added support for .NET Standard 1.6
Nothing published for this version
This is a catch-up release of cumulative changes to NBuilder that have accrued since the last offical release in 2011. As it's been 5 years since the
This is a catch-up release of cumulative changes to NBuilder that have accrued since the last offical release in 2011. As it's been 5 years since the last official release, it's hard to know everthing that's changed.
Any method previously marked with the Obsolete attribute has now been removed.
As Silverlight is effective a dead technology, we have officially ended support for it. This will allow us to better focus on a forthcoming release with .NET Core support.
Builder has a non-static implementation.This will allow you to create customized BuilderSettings for different testing scenarios.
Old Code
var results = Builder<MyObject>.CreateListOfSize(10).Build();
New Code
var settings = new BuilderSettings()
var results = new Builder(settings).CreateListOfSize<MyObject>(10).Build();
With and Do action now supports a signature that receives an indexExample
var builderSettings = new BuilderSettings();
var list = new Builder(builderSettings)
.CreateListOfSize<MyClassWithConstructor>(10)
.All()
.Do((row, index) => row.Int = index*2)
.WithConstructor(() => new MyClassWithConstructor(1, 2f))
.Build();
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →