Created
June 11, 2013 15:04
-
-
Save bitsprint/5757625 to your computer and use it in GitHub Desktop.
Example Data Builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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