Skip to content

How to fill bool property with default value #172

Description

@vabic

Ex:

    class User
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public IsActive { get; set; } = true;
    }
           GenFu.Configure<User>()
                .Fill(g => g.FirstName , () => $"FirstName-{Guid.NewGuid()}")
                .Fill(g => g.LastName , () => $"LastName -{Guid.NewGuid()}")
                .Fill(g => g.IsActive).WithRandom(new [] {true, false});

var users = A.ListOf<User>(20);

All users have the IsActive property set to default value (IsActive == true);
In debug, the setter property are never called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions