Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/JamesKovacs/FactoryGirl.NET

A .NET implementation of Thoughtbot's factory_girl for Ruby
https://github.com/JamesKovacs/FactoryGirl.NET

Last synced: 14 days ago
JSON representation

A .NET implementation of Thoughtbot's factory_girl for Ruby

Awesome Lists containing this project

README

        

FactoryGirl.NET
===============
Minimal implementation of Ruby's [factory\_girl](http://github.com/thoughtbot/factory_girl) in .NET.
If you are familiar with factory\_girl in Ruby, we only support defining factories and building objects
using those factories. We do not support create (e.g. saving to the database), attributes\_for, or
build\_stubbed yet.

To define a factory:

FactoryGirl.Define(() => new User {
FirstName = "John",
LastName = "Doe",
Admin = false
});

To use a factory:

var user = FactoryGirl.Build();

To customize the object being built:

var admin = FactoryGirl.Build(x => x.Admin = true);

Copyright © 2012 [James Kovacs](http://jameskovacs.com)