asiftasleem / nbuilder

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

Building a Guid changes Guid.Empty to be 1 #94

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
How to reproduce:
1.Use NBuilder to create a new Guid, eg: "Builder<Guid>.CreateNew().Build();"
2.Compare Guid.Empty to new Guid() or default(Guid).

What is the expected output?
Guid.Empty should equal new Guid() or default(Guid)

What do you see instead?
Guid.Empty has been changed to  {00000000-0000-0000-0000-000000000001}, while 
new Guid() and default(Guid) are {00000000-0000-0000-0000-000000000000}.

Using version NBuilder version 3.0.1.0 in .NET 4.5 on Windows 8.1

Here's an example NUnit test. You should set a breakpoint to see the different 
values:

[Test]
public void test_guid()
{
    var guid1 = Guid.Empty;
    var guid2 = new Guid();
    var guid3 = Builder<Guid>.CreateNew().Build();
    var guid4 = Guid.Empty;

    guid1.Should().Be(guid4);
}

Original issue reported on code.google.com by CBig...@gmail.com on 10 Dec 2014 at 6:14

Attachments: