Beispiel #1
0
 private static byte[][] GetImages()
 {
     using (var client = new HttpClient())
     {
         var imageFaker = new Internet();
         return(Task.WhenAll(Enumerable.Repeat(client.GetByteArrayAsync(imageFaker.Avatar()), 10))
                .ConfigureAwait(false).GetAwaiter().GetResult());
     }
 }
Beispiel #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()
            };
        }
Beispiel #3
0
        public void can_get_avatar()
        {
            var avatar = internet.Avatar();

            avatar.Should().Be("https://s3.amazonaws.com/uifaces/faces/twitter/nasirwd/128.jpg");
        }
Beispiel #4
0
 public static string Avatar() => Internet.Avatar();
Beispiel #5
0
        public void can_get_avatar()
        {
            var avatar = internet.Avatar();

            avatar.Should().Be("https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/754.jpg");
        }