Skip to content

Instantly share code, notes, and snippets.

@bitsprint
Created June 11, 2013 15:04
Show Gist options
  • Select an option

  • Save bitsprint/5757625 to your computer and use it in GitHub Desktop.

Select an option

Save bitsprint/5757625 to your computer and use it in GitHub Desktop.
Example Data Builder
namespace Tests.Domain.Builders
{
using System;
using System.Collections.ObjectModel;
using global::Core.Tests.Builders;
using Domain;
public class FooBuilder : TestDataBuilder<FooBuilder, Foo>
{
public LeadBuilder()
{
this.Entity.Id = Guid.NewGuid();
this.Entity.Bar = "ABC";
this.Entity.Baz = 123;
}
public LeadBuilder WithBar(string value = "XYZ")
{
this.Entity.Bar = value;
return this;
}
public LeadBuilder WithBaz(int value = 456)
{
this.Entity.Baz = value;
return this;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment