Beispiel #1
0
 public static string Email()
 {
     if (NumberFaker.Number(5) != 2)
     {
         return(string.Concat(NameFaker.FirstName().ToLower(), "@", InternetFaker.Domain()));
     }
     return(string.Concat(NameFaker.FirstName().ToLower(), StringFaker.Numeric(2), "@", InternetFaker.Domain()));
 }
Beispiel #2
0
 public void StringFakerTest()
 {
     DisplayAndExecute(new Expression <Func <string> >[] {
         () => StringFaker.Alpha(5),
         () => StringFaker.AlphaNumeric(5),
         () => StringFaker.Numeric(5),
         () => StringFaker.Randomize("### ??"),
     });
 }
Beispiel #3
0
        public Member Random()
        {
            var mc = new Fixture().Build <Member>()
                     .With(x => x.Username, NameFaker.Name())
                     .With(x => x.Email, "patogun+" + StringFaker.AlphaNumeric(10) + "@gmail.com")
                     .With(x => x.Password, "Password123")
                     .OmitAutoProperties()
                     .Create();

            return(mc);
        }
Beispiel #4
0
 public void Generate()
 {
     foreach (Castes s in (Castes[])Enum.GetValues(typeof(Castes)))
     {
         Console.WriteLine(s);
         for (int i = 0; i <= Max; i++)
         {
             Console.WriteLine(Faker.NameFaker.FirstName());
             Console.WriteLine(StringFaker.SelectFrom(1, "abc"));
         }
     }
 }
Beispiel #5
0
        public static Product GetProduct()
        {
            var product = new Product()
            {
                Id           = Guid.NewGuid(),
                Category     = StringFaker.Alpha(10),
                Condition    = TextFaker.Sentences(4),
                Description  = TextFaker.Sentences(7),
                Name         = StringFaker.Alpha(40),
                Location     = LocationFaker.City(),
                Manufacturer = StringFaker.Alpha(25),
                Price        = NumberFaker.Number(1, 500)
            };

            return(product);
        }
Beispiel #6
0
 private IEnumerable <InstanceInfo> CreateSomeRandomInstances()
 {
     for (int i = 0; i < NumberFaker.Number(10, 20); i++)
     {
         yield return(new InstanceInfo()
         {
             InstanceId = "i-" + StringFaker.AlphaNumeric(8).ToLower(),
             IpAddress = IpAddressFaker.IpAddress(),
             Status = NumberFaker.Number(1, 10) < 9 ? InstanceStatuses.Running : InstanceStatuses.Pending,
             WorkerInfo = new WorkerInfo()
             {
                 WorkerOnline = false
             }
         });
     }
 }
Beispiel #7
0
        public void TestSetup()
        {
            converter = new ProductConverter();

            fakeProduct = new Product
            {
                Id                           = NumberFaker.Number(1, int.MaxValue),
                Name                         = StringFaker.Alpha(20),
                ReleaseDate                  = DateTime.Now,
                Notes                        = TextFaker.Sentences(5),
                LicenseEncryptionType        = EncryptionType.RSA_4096,
                PrivateKey                   = StringFaker.AlphaNumeric(50),
                PublicKey                    = StringFaker.AlphaNumeric(50),
                DefaultLockProperties        = LockPropertyType.CPU | LockPropertyType.BIOS,
                FailOnNullHardwareIdentifier = BooleanFaker.Boolean(),
                PermittedActivationTypes     = ActivationMethodType.Manual | ActivationMethodType.Email,
                PermittedExpirationTypes     = LicenseType.Service,
                VersionLeeway                = VersionLeewayType.Strict,
            };

            fakeViewmodel = new ProductViewModel
            {
                Id          = NumberFaker.Number(1, int.MaxValue),
                Name        = StringFaker.Alpha(20),
                ReleaseDate = DateTime.Now,
                Notes       = TextFaker.Sentences(5),
                SelectedDefaultLockProperties = new List <string> {
                    ((int)LockPropertyType.CPU).ToString(), ((int)LockPropertyType.BIOS).ToString()
                },
                FailOnNullHardwareIdentifier = BooleanFaker.Boolean(),
                PermittedActivationTypes     = new List <string> {
                    ((int)ActivationMethodType.Manual).ToString(), ((int)ActivationMethodType.Email).ToString()
                },
                // randomly selects a versionleewaytype
                VersionLeeway = ((int)VersionLeewayType.Strict).ToString()
            };
        }
Beispiel #8
0
        public void SetUp()
        {
            converter = new CustomerConverter();

            fakeEntity = new Customer
            {
                Id            = NumberFaker.Number(1, int.MaxValue),
                Name          = StringFaker.Alpha(25),
                StreetAddress = new Address
                {
                    Address1   = LocationFaker.Street(),
                    Address2   = LocationFaker.Street(),
                    City       = LocationFaker.City(),
                    State      = StringFaker.Alpha(2),
                    PostalCode = LocationFaker.PostCode(),
                    Country    = LocationFaker.Country()
                },
                BillingAddress = new Address
                {
                    Address1   = LocationFaker.Street(),
                    Address2   = LocationFaker.Street(),
                    City       = LocationFaker.City(),
                    State      = StringFaker.Alpha(2),
                    PostalCode = LocationFaker.PostCode(),
                    Country    = LocationFaker.Country()
                },
                OfficePhone1   = PhoneFaker.Phone(),
                OfficePhone2   = PhoneFaker.Phone(),
                OfficeFax      = PhoneFaker.Phone(),
                Email          = InternetFaker.Email(),
                PrimaryContact = new HumanContact
                {
                    FirstName = NameFaker.FirstName(),
                    LastName  = NameFaker.LastName(),
                    Email     = InternetFaker.Email(),
                    Fax       = PhoneFaker.Phone(),
                    Phone1    = PhoneFaker.Phone(),
                    Phone2    = PhoneFaker.Phone(),
                    Notes     = TextFaker.Sentence()
                },
                Notes = TextFaker.Sentences(5)
            };

            fakeViewModel = new CustomerViewModel
            {
                Id   = NumberFaker.Number(1, int.MaxValue),
                Name = StringFaker.Alpha(25),
                CanLicensePreReleaseVersions = BooleanFaker.Boolean(),
                StreetAddress = new Address
                {
                    Address1   = LocationFaker.Street(),
                    Address2   = LocationFaker.Street(),
                    City       = LocationFaker.City(),
                    State      = StringFaker.Alpha(2),
                    PostalCode = LocationFaker.PostCode(),
                    Country    = LocationFaker.Country()
                },
                BillingMatchesStreetAddress = BooleanFaker.Boolean(),
                BillingAddress = new Address
                {
                    Address1   = LocationFaker.Street(),
                    Address2   = LocationFaker.Street(),
                    City       = LocationFaker.City(),
                    State      = StringFaker.Alpha(2),
                    PostalCode = LocationFaker.PostCode(),
                    Country    = LocationFaker.Country()
                },
                OfficePhone1   = PhoneFaker.Phone(),
                OfficePhone2   = PhoneFaker.Phone(),
                OfficeFax      = PhoneFaker.Phone(),
                Email          = InternetFaker.Email(),
                PrimaryContact = new HumanContact
                {
                    FirstName = NameFaker.FirstName(),
                    LastName  = NameFaker.LastName(),
                    Email     = InternetFaker.Email(),
                    Fax       = PhoneFaker.Phone(),
                    Phone1    = PhoneFaker.Phone(),
                    Phone2    = PhoneFaker.Phone(),
                    Notes     = TextFaker.Sentence()
                },
                Notes = TextFaker.Sentences(5)
            };
        }
Beispiel #9
0
 public static string Phone()
 {
     return(StringFaker.Randomize("###-###-#####"));
 }
Beispiel #10
0
 public static string InternationalPhone()
 {
     return(StringFaker.Randomize("+##-(0)####-####-####"));
 }
Beispiel #11
0
 public static string ZipCode()
 {
     return(StringFaker.Numeric(5));
 }
Beispiel #12
0
 public static string PostCode()
 {
     return(StringFaker.Randomize("????? ##").ToUpper());
 }
Beispiel #13
0
        public void Pupolate()
        {
            var user = new User()
            {
                UserName  = StringFaker.AlphaNumeric(12),
                FirstName = "Jahirul",
                LastName  = "Islam"
            };

            userRepo.Add(user);
            user = new User()
            {
                UserName  = StringFaker.AlphaNumeric(12),
                FirstName = "Monirul",
                LastName  = "Islam"
            };
            userRepo.Add(user);
            user = new User()
            {
                UserName  = StringFaker.AlphaNumeric(12),
                FirstName = "Aminul",
                LastName  = "Islam"
            };
            userRepo.Add(user);
            user = new User()
            {
                UserName  = StringFaker.AlphaNumeric(12),
                FirstName = "Fukrul",
                LastName  = "Islam"
            };
            userRepo.Add(user);

            user = new User()
            {
                UserName  = StringFaker.AlphaNumeric(12),
                FirstName = "Najrul",
                LastName  = "Islam"
            };
            userRepo.Add(user);

            user = new User()
            {
                UserName  = StringFaker.AlphaNumeric(12),
                FirstName = "Kamrul",
                LastName  = "Islam"
            };
            userRepo.Add(user);

            for (var i = 0; i < 1000; i++)
            {
                user = new User()
                {
                    UserName  = StringFaker.AlphaNumeric(12),
                    FirstName = NameFaker.FirstName(),
                    LastName  = NameFaker.LastName()
                };
                userRepo.Add(user);
            }
            for (var i = 0; i < 10; i++)
            {
                user = new User()
                {
                    UserName  = StringFaker.AlphaNumeric(12),
                    FirstName = ArrayFaker.SelectFrom("Jahirul", "Monirul", "Aminul", "Fukrul", "Najrul", "Kamrul"),
                    LastName  = ArrayFaker.SelectFrom("Islam", "Bhuiyan", "Khan", "")
                };
                userRepo.Add(user);
            }
        }