I've added some features to AutoPoco to make it actually functional
Configuration can now be done automatically:
IGenerationSessionFactory factory = AutoPocoContainer.Configure(x =>
{
x.Conventions(c =>
{
c.UseDefaultConventions();
});
x.AddFromAssemblyContainingType<SimpleUser>();
});
As to start with, meaningful data isn't always required - just non-nulls and sensible defaults.
Collections can now be created with controlled content, for example:
mSession.List<SimpleUser>()
.Random(5)
.Impose(x => x.FirstName, "Bob")
.Next(5)
.Impose(x => x.FirstName, "Alice")
.All()
.First(5)
.Impose(x => x.LastName, "Blue")
.Next(5)
.Impose(x => x.FirstName, "Red")
.All()
.Get();
Will create a table of data looking something like:
| # | First Name | Last Name |
|---|---|---|
| 0 | Bob | Blue |
| 1 | Alice | Blue |
| 2 | Alice | Blue |
| 3 | Bob | Blue |
| 4 | Bob | Blue |
| 5 | Alice | Red |
| 6 | Bob | Red |
| 7 | Alice | Red |
| 8 | Bob | Red |
| 9 | Alice | Red |
Obviously these simple examples are only the beginning, I've also written some documentation for the existing features + new features over at the codeplex site:
I'll be using AutoPoco to generate a ridiculous amount of test data for one of our systems in the coming weeks, so I'll no doubt discover any shortcomings and rectify them, in the mean-time feel free to ask for things in the discussons forum at the Codeplex site (or in the comments here)
2020 © Rob Ashton. ALL Rights Reserved.