Skip to content

Get Factory definitions from a namespace or an assembly #2

@lgcrespo

Description

@lgcrespo

I know that in the real ruby version, you just call FactoryGirl define method anywhere in a file and that adds the factory and makes it ready to be used.

However, given that in .NET we need to have a class to put code inside, that technique suggests to have a static class with the factory definitions inside a constructor perhaps or have some group of classes that contain inside a group of factory definitions.

Perhaps it could be useful to have a method like FactoryGirl.AddDefinitionsFromNamespace() or FactoryGirl.AddDefinitionsFromAssembly() and a group of methods like that, and define some interface to register factories, like:

public interface IFactoryDefinition<T>{
    public Func Define();
}

or something like that. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions