Ejemplo n.º 1
0
    public void GeneratePackage()
    {
        //assigns random data to the box the player must check matches screen
        var random = new Bogus.Randomizer();
        var data   = new Bogus.DataSets.Commerce("en");
        var local  = new Bogus.DataSets.Address("en");
        var user   = new Bogus.DataSets.Name("en");

        zip     = local.ZipCode();
        address = local.StreetAddress();
        ID      = random.Number(1, 9999);
        item    = data.Product();
        name    = user.FullName();
    }
Ejemplo n.º 2
0
        protected virtual void Initialize(string locale)
        {
            var gname = new Name(locale);

            this.FirstName = gname.FirstName();
            this.LastName = gname.LastName();

            var ginternet = new Internet(locale);

            this.UserName = ginternet.UserName(this.FirstName, this.LastName);
            this.Email = ginternet.Email(this.UserName, this.LastName);
            this.Website = ginternet.DomainName();
            this.Avatar = ginternet.Avatar();

            var gdate = new Date() { Locale = locale };

            this.DateOfBirth = gdate.Past(50, DateTime.Now.AddYears(-20));

            var gphone = new PhoneNumbers(locale);
            this.Phone = gphone.PhoneNumber();

            var gaddress = new Address(locale);

            this.Address = new CardAddress
                {
                    Street = gaddress.StreetAddress(),
                    Suite = gaddress.SecondaryAddress(),
                    City = gaddress.City(),
                    ZipCode = gaddress.ZipCode(),
                    Geo = new CardAddress.CardGeo
                        {
                            Lat = gaddress.Latitude(),
                            Lng = gaddress.Longitude()
                        }
                };

            var gcompany = new Company(locale);

            this.Company = new CardCompany
                {
                    Name = gcompany.CompanyName(),
                    CatchPhrase = gcompany.CatchPhrase(),
                    Bs = gcompany.Bs()
                };

        }
Ejemplo n.º 3
0
    public void GenerateAnswer(int num)
    {
        //if num is 1 generate 1 false answer if not set the answer to the values already asssigned
        var random = new Bogus.Randomizer();
        var data   = new Bogus.DataSets.Commerce("en");
        var local  = new Bogus.DataSets.Address("en");
        var user   = new Bogus.DataSets.Name("en");

        reject   = false;
        zipA     = zip;
        addressA = address;
        nameA    = name;
        IDA      = ID;
        itemA    = item;
        if (num == 1)
        {
            reject = true;
            int numb = random.Number(1, 5);
            if (numb == 1)
            {
                zipA = zip = local.ZipCode();
            }
            if (numb == 2)
            {
                address = local.StreetAddress();
            }
            if (numb == 3)
            {
                ID = random.Number(1, 9999);
            }
            if (numb == 4)
            {
                item = data.Product();
            }
            else
            {
                name = user.FullName();
            }
        }
    }