private static Estacion MakeEstacion(Coord?coord = null) { IPostprocessComposer <Estacion> builder = fixture.Build <Estacion>(); if (coord != null) { builder = builder.With(e => e.Coord, coord.Value); } return(builder.Create()); }
public IEventGeneratingScenarioGivenStateBuilder Given <TEvent>(string identifier, Func <IPostprocessComposer <TEvent>, IPostprocessComposer <TEvent> > customize = null) { IPostprocessComposer <TEvent> composer = _fixture.Build <TEvent>(); if (customize != null) { composer = customize(composer); } var @event = composer.Create(); return(new AutoAutoFixtureTestBuilder(Given(identifier, @event), _fixture)); }
public static IEnumerable <T> CreateMany <T>(this IPostprocessComposer <T> composer, int numberOfObjects) { if (numberOfObjects < 0) { throw new ArgumentException("The number of objects is negative!"); } IList <T> collection = new List <T>(); for (int i = 0; i < numberOfObjects; i++) { collection.Add(composer.Create <T>()); } return(collection); }
public virtual object Create(object request, ISpecimenContext context) => _builder.Create(request, context);