Skip to content

NUnit4002 shuoldn't trigger for T vs nullable<T> struct types #879

@MaceWindu

Description

@MaceWindu
class SomeType
{
    public Guid? Id { get; set; }
}

// proper assert : id != guid.empty
Assert.That(obj.Id, Is.Not.EqualTo(default(Guid)));

// suggested incorrect assert : Id != null
Assert.That(obj.Id, Is.Not.Default);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions