asiftasleem / nbuilder

Automatically exported from code.google.com/p/nbuilder
0 stars 0 forks source link

Population of properties declared as nullable types #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. Create a custom class with a nullable type property, e.g.
public class Foo
{
    public int Bar { get; set; }
    public int? Gum { get; set; }
}

2. Create an instance of this class with NBuilder, eg..

var foo = Builder<Foo>.CreateNew().Build();

The resulting object has Bar set to 1, but Gum is set to null. I would
expect Gum to have a non-null value assigned, e.g. (int?)1

NBuilder version 2.1.9 (beta) on Windows XP SP2 32 bit.

Original issue reported on code.google.com by adam.ra...@gmail.com on 28 Jan 2010 at 12:26

GoogleCodeExporter commented 8 years ago
Patch to implement this feature. 

Fixed PropertyNamer.GetMemberType to return the underlying system type if type 
is
nullable

Original comment by andy78sm...@gmail.com on 22 Apr 2010 at 3:29

Attachments:

GoogleCodeExporter commented 8 years ago
Nice fix Andy, thanks!

Original comment by adam.ra...@gmail.com on 23 Apr 2010 at 6:38

GoogleCodeExporter commented 8 years ago
I'll take a look at this soon and see if I can integrate it into the project.

Original comment by joshuajr...@gmail.com on 8 Sep 2010 at 3:53

GoogleCodeExporter commented 8 years ago
I have integrated anydy78smith's patch at revision 64. Thanks for the patch 
Andy! It made my job so much easier.

Original comment by joshuajr...@gmail.com on 9 Sep 2010 at 12:53

GoogleCodeExporter commented 8 years ago
I've added a unit test around the change that was missed at revision 77. 
Previously, the functionality was only being covered by a functional test.

Original comment by joshuajr...@gmail.com on 21 Oct 2010 at 11:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by garethdo...@googlemail.com on 6 Nov 2010 at 11:07

GoogleCodeExporter commented 8 years ago

Original comment by garethdo...@googlemail.com on 11 Nov 2010 at 9:39

GoogleCodeExporter commented 8 years ago
This was fixed in version 3.0

Original comment by joshuajr...@gmail.com on 30 Nov 2011 at 12:39