Example #1
0
 public FakerContainer()
 {
     Address       = new AddressFaker(this);
     App           = new AppFaker(this);
     Beer          = new BeerFaker(this);
     Book          = new BookFaker(this);
     Boolean       = new BooleanFaker();
     Business      = new BusinessFaker(this);
     Color         = new ColorFaker(this);
     Company       = new CompanyFaker(this);
     Date          = new DateFaker();
     Fake          = new FakeFaker(this);
     Friends       = new FriendsFaker(this);
     GameOfThrones = new GameOfThronesFaker(this);
     Lorem         = new LoremFaker(this);
     Name          = new NameFaker(this);
     Number        = new NumberFaker();
     Pokemon       = new PokemonFaker(this);
     Random        = new RandomFaker();
     RockBand      = new RockBandFaker(this);
     Superhero     = new SuperheroFaker(this);
     Team          = new TeamFaker(this);
     Time          = new TimeFaker();
     TwinPeaks     = new TwinPeaksFaker(this);
     Zelda         = new ZeldaFaker(this);
 }
Example #2
0
        public void Pupolate()
        {
            var controller = new UserController(new UserBLL());
            var userList   = controller.GetAllUsers(100, 1, NameFaker.FirstName());

            var userIds = userList.Select(r => r.Id).ToArray();

            for (var i = 0; i < 1000; i++)
            {
                var friend = new Friend()
                {
                    FriendId   = ArrayFaker.SelectFrom(1, userIds).First(),
                    UserId     = ArrayFaker.SelectFrom(1, userIds).First(),
                    IsAccepted = BooleanFaker.Boolean()
                };
                friendRepo.Add(friend);
            }

            userList = controller.GetAllUsers(10, 1,
                                              ArrayFaker.SelectFrom("Jahirul", "Monirul", "Aminul", "Fukrul", "Najrul", "Kamrul"));

            userIds = userList.Select(r => r.Id).ToArray();

            for (var i = 0; i < 10; i++)
            {
                var friend = new Friend()
                {
                    FriendId   = ArrayFaker.SelectFrom(1, userIds).First(),
                    UserId     = ArrayFaker.SelectFrom(1, userIds).First(),
                    IsAccepted = BooleanFaker.Boolean()
                };
                friendRepo.Add(friend);
            }
        }
Example #3
0
 public static string FirstName()
 {
     if (!BooleanFaker.Boolean())
     {
         return(NameFaker.MaleFirstName());
     }
     return(NameFaker.FemaleFirstName());
 }
Example #4
0
 public FakerContainer()
 {
     App     = new AppFaker(this);
     Book    = new BookFaker(this);
     Boolean = new BooleanFaker();
     Date    = new DateFaker();
     Fake    = new FakeFaker(this);
     Name    = new NameFaker(this);
     Number  = new NumberFaker();
     Random  = new RandomFaker();
     Time    = new TimeFaker();
 }
Example #5
0
        public static string StreetName()
        {
            string[] strArray = new string[] { "Highland", "Hill", "Park", "Woodland", "Sunset", "Virginia" };
            string   str      = ArrayFaker.SelectFrom <string>(strArray);

            if (!BooleanFaker.Boolean())
            {
                string[] strArray1 = new string[] { "Adams", "Franklin", "Jackson", "Jefferson", "Lincoln", "Madison", "Washington", "Wilson" };
                return(string.Concat(ArrayFaker.SelectFrom <string>(strArray1), " ", str));
            }
            string[] strArray2 = new string[] { "Acacia", "Beech", "Birch", "Cedar", "Cherry", "Chestnut", "Elm", "Larch", "Laurel", "Linden", "Maple", "Oak", "Pine", "Rose", "Walnut", "Willow" };
            return(string.Concat(ArrayFaker.SelectFrom <string>(strArray2), " ", str));
        }
Example #6
0
 public FakerContainer()
 {
     Address        = new AddressFaker(this);
     Ancient        = new AncientFaker(this);
     App            = new AppFaker(this);
     Avatar         = new AvatarFaker(this);
     Beer           = new BeerFaker(this);
     Book           = new BookFaker(this);
     Boolean        = new BooleanFaker();
     Business       = new BusinessFaker(this);
     Cat            = new CatFaker(this);
     ChuckNorris    = new ChuckNorrisFaker(this);
     Coffee         = new CoffeeFaker(this);
     Color          = new ColorFaker(this);
     Company        = new CompanyFaker(this);
     Date           = new DateFaker();
     DragonBall     = new DragonBallFaker(this);
     Educator       = new EducatorFaker(this);
     Fake           = new FakeFaker(this);
     File           = new FileFaker(this);
     Fillmurray     = new FillmurrayFaker();
     Food           = new FoodFaker(this);
     Friends        = new FriendsFaker(this);
     GameOfThrones  = new GameOfThronesFaker(this);
     Hacker         = new HackerFaker(this);
     HarryPotter    = new HarryPotterFaker(this);
     Internet       = new InternetFaker(this);
     LordOfTheRings = new LordOfTheRingsFaker(this);
     Lorem          = new LoremFaker(this);
     Music          = new MusicFaker(this);
     Name           = new NameFaker(this);
     Number         = new NumberFaker();
     PhoneNumber    = new PhoneNumberFaker(this);
     Placeholdit    = new PlaceholditFaker(this);
     Pokemon        = new PokemonFaker(this);
     Random         = new RandomFaker();
     RickAndMorty   = new RickAndMortyFaker(this);
     RockBand       = new RockBandFaker(this);
     SlackEmoji     = new SlackEmojiFaker(this);
     Space          = new SpaceFaker(this);
     StarWars       = new StarWarsFaker(this);
     Superhero      = new SuperheroFaker(this);
     Team           = new TeamFaker(this);
     Time           = new TimeFaker();
     TwinPeaks      = new TwinPeaksFaker(this);
     University     = new UniversityFaker(this);
     Vehicle        = new VehicleFaker(this);
     Zelda          = new ZeldaFaker(this);
 }
Example #7
0
 public FakerContainer()
 {
     Address  = new AddressFaker(this);
     App      = new AppFaker(this);
     Book     = new BookFaker(this);
     Boolean  = new BooleanFaker();
     Business = new BusinessFaker(this);
     Date     = new DateFaker();
     Fake     = new FakeFaker(this);
     Friends  = new FriendsFaker(this);
     Lorem    = new LoremFaker(this);
     Name     = new NameFaker(this);
     Number   = new NumberFaker();
     Pokemon  = new PokemonFaker(this);
     Random   = new RandomFaker();
     Time     = new TimeFaker();
     Zelda    = new ZeldaFaker(this);
 }
Example #8
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()
            };
        }
Example #9
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)
            };
        }
Example #10
0
 public void SetUp()
 {
     _randomWrapper = new RandomWrapper();
     _booleanFaker  = new BooleanFaker(_randomWrapper);
 }
Example #11
0
 public void BooleanFakerTest()
 {
     DisplayAndExecute(new Expression <Func <bool> >[] {
         () => BooleanFaker.Boolean()
     });
 }