Closed ildoc closed 4 years ago
You shouldn't need to do anything special to fill nullable properties. Can you try var things = A.ListOf<Thing>(50)
without doing anything to Configure
first?
When I try this on genfu.io, it works without configuration.
I'm having the same issue as well - i think that website testbed might be doing some different config, so i pasted the code int a unit test
public class Thing
{
public int? Id { get; set; }
public string Description { get; set; }
public DateTime? Timestamp { get; set; }
}
[TestMethod]
public void TestMethod_2()
{
var things = A.ListOf<Thing>(5);
foreach (var thing in things)
{
Debug.WriteLine($"Id: {thing.Id}, Descritpion: {thing.Description}, TimeStamp: {thing.Timestamp}");
}
}
and here's the debug output
Id: , Descritpion: pack, TimeStamp:
Id: , Descritpion: williamsburg, TimeStamp:
Id: , Descritpion: pack, TimeStamp:
Id: , Descritpion: apparel, TimeStamp:
Id: , Descritpion: government, TimeStamp:
I think there was indeed a bug on this. Can you try the latest version?
On Wed, Mar 7, 2018 at 11:54 PM, markp notifications@github.com wrote:
I'm having the same issue as well - i think that website testbed might be doing some different config, so i pasted the code int a unit test
public class Thing { public int? Id { get; set; } public string Description { get; set; } public DateTime? Timestamp { get; set; } } [TestMethod] public void TestMethod_2() { var things = A.ListOf<Thing>(5); foreach (var thing in things) { Debug.WriteLine($"Id: {thing.Id}, Descritpion: {thing.Description}, TimeStamp: {thing.Timestamp}"); } }
and here's the debug output
Id: , Descritpion: pack, TimeStamp: Id: , Descritpion: williamsburg, TimeStamp: Id: , Descritpion: pack, TimeStamp: Id: , Descritpion: apparel, TimeStamp: Id: , Descritpion: government, TimeStamp:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MisterJames/GenFu/issues/134#issuecomment-371397433, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJZOBjj7p595ZM-EBG90BEerhq2eLISks5tcNW7gaJpZM4SIFPW .
Awesome - just updated to the latest version (1.4.22) - All seems to working great!
Not a bug, but since I couldn't find any documentation, I don't know where else to ask for support...
I have a class like this:
And I configured like this:
but when I create a list with
var things = A.ListOf<Thing>(50);
, all of them have Id and Timestamp as null(I'm using it in a .NET framework 4.6.2 project)
What I'm missing? How can I force nullable properties to be filled?