Skip to content

Is there a way to produce random addresses that are country specific? #318

Closed
@tLashbrooke

Description

Trying to generate addresses unique to the UK i.e. country can only be England, Wales, Scotland, Northern Ireland. Counties seems to work. The code I'm using is below, but it's printing out random country names in English

var LocalAddress = new Bogus.DataSets.Address(locale: "en_GB");
            var Name = new Bogus.DataSets.Name(locale: "en_GB");
            
            this.FirstName = Name.FirstName();
            this.LastName = Name.LastName();


            this.Country = LocalAddress.Country();
            this.County = LocalAddress.County();
            
            this.HouseNumber = LocalAddress.BuildingNumber();
            this.StreetName = LocalAddress.StreetName();
            this.City = LocalAddress.City();

            this.PostCode = LocalAddress.ZipCode();`

image

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