You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
In the past, I've just explicitly called some static helper methods in a test assembly startup class. I could see something like this being useful in a larger project.
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:
or something like that. What do you think?
The text was updated successfully, but these errors were encountered: