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); }
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); } }
public static void DowningIntermediary(string interTxt = "") { if (interTxt == "") { interTxt = NameFaker.FirstName(); } Browser.EnterText(By.XPath(Intermediary), interTxt); }
public static void DowningFirstName(string firstNameTxt = "") { if (firstNameTxt == "") { firstNameTxt = NameFaker.FirstName(); } Browser.EnterText(By.XPath(FirstName), firstNameTxt); }
public static string FirstName() { if (!BooleanFaker.Boolean()) { return(NameFaker.MaleFirstName()); } return(NameFaker.FemaleFirstName()); }
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())); }
public static void DowningLastName(string lastNameTxt = "") { if (lastNameTxt == "") { lastNameTxt = NameFaker.LastName(); } Browser.EnterText(By.XPath(LastName), lastNameTxt); }
public void DeveRetornarSobreNomeInvalida() { name = NameFaker.Gerar(); var vO = name.Generate(); add = new Name(vO.FirstName, ""); Assert.True(add.Invalid); }
public void DeveRetornarNomeValido() { name = NameFaker.Gerar(); var vO = name.Generate(); add = new Name(vO.FirstName, vO.LastName); Assert.True(add.Valid); }
public void DeveRetornarPrimeiroNomeInvalida() { name = NameFaker.Gerar(); var vO = name.Generate(); add = new Name("", vO.LastName); Assert.True(add.Invalid); }
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); }
public void NameFakerTest() { DisplayAndExecute(new Expression <Func <string> >[] { () => NameFaker.FemaleFirstName(), () => NameFaker.FemaleName(), () => NameFaker.FirstName(), () => NameFaker.LastName(), () => NameFaker.MaleFirstName(), () => NameFaker.MaleName(), () => NameFaker.Name(), }); }
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(); }
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); }
public static Book Generate() { var lipsumGenerator = new LipsumGenerator(); return(new Book { Key = Guid.NewGuid().ToString(), Title = lipsumGenerator.GenerateSentences(1, Sentence.Short)[0], Abstract = lipsumGenerator.GenerateParagraphs(1, Paragraph.Medium)[0], Authors = new string[] { NameFaker.Name(), NameFaker.Name() }, Price = 9999m * (decimal)_rand.NextDouble() + 0.99m, ReleaseDate = DateTimeFaker.BirthDay(), Pages = _rand.Next(5, 3000), Category = EnumFaker.SelectFrom <BookCategory>() }); }
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); }
public void DeveRetornaSobreNomeTamanhoInvalido() { name = NameFaker.Gerar(); var vO = name.Generate(); int i = 0; string length = ""; while (i < 40) { length += "teste"; i++; } add = new Name(vO.FirstName, vO.LastName + length); Assert.True(add.Invalid); }
public static Faker <Student> Gerar() { Faker <Student> student = new Faker <Student>("pt_BR") .RuleFor(s => s.Name, NameFaker.Gerar()) .RuleFor(s => s.Parents, ParentFaker.Gerar().Generate(2)) .RuleFor(s => s.Address, AddressFaker.Gerar()) .RuleFor(s => s.BirthDate, f => f.Date.Soon()) .RuleFor(s => s.ETypeOfEducation, f => f.PickRandom <ETypeOfEducation>()) .RuleFor(s => s.AcademicYear, f => f.Date.Soon()) .RuleFor(s => s.Serie, f => f.Random.Int(1)) .RuleFor(s => s.Grade, f => f.Random.String(1)) .RuleFor(s => s.Serie, f => f.Random.Int(1)) .RuleFor(s => s.Shifts, f => f.PickRandom <EShifts>()) .RuleFor(s => s.CalledNumber, f => f.Random.Int(1, 30)) .RuleFor(s => s.Note, f => f.Lorem.Paragraphs(1)) .RuleFor(s => s.School, SchoolFaker.Gerar()) .RuleFor(s => s.Occurrences, OccurrenceFaker.Gerar().Generate(1)); return(student); }
public IActionResult Create([FromBody] Kitty kitten) { //Genera namn och id string id = Guid.NewGuid().ToString(); var kitty = new Kitty { Id = id, Name = NameFaker.Name(), Body = kitten.Body, Pattern = kitten.Pattern, Mouth = kitten.Mouth, Eye = kitten.Eye }; kittyContext.KittyItems.Add(kitty); kittyContext.SaveChanges(); var result = new ObjectResult(kitty); result.StatusCode = 201; return(result); }
/// <summary> /// Fakes the first name. /// </summary> /// <returns></returns> public string FakeFirstName() { return(NameFaker.FirstName()); }
public void FakerTest() { var faker = new NameFaker(); faker.InitializeData(); Assert.AreEqual("Shtiphan", faker.Fake("Steven")); Assert.AreEqual("Sbylborg", faker.Fake("Spielberg")); Assert.AreEqual("Sthanli", faker.Fake("Stanley")); Assert.AreEqual("Cuprigg", faker.Fake("Kubrick")); Assert.AreEqual("Ronamn", faker.Fake("Roman")); Assert.AreEqual("Bollonsghi", faker.Fake("Polanski")); Assert.AreEqual("Hanrih", faker.Fake("Henry")); Assert.AreEqual("Kattamerunn", faker.Fake("Cutamaran")); Assert.AreEqual("Halphrit", faker.Fake("Alfred")); Assert.AreEqual("Hidshgogg", faker.Fake("Hitchcock")); Assert.AreEqual("Ouwart", faker.Fake("Howard")); Assert.AreEqual("Havkz", faker.Fake("Hawks")); Assert.AreEqual("Dytmer", faker.Fake("Dietmar")); Assert.AreEqual("Hjüpsh", faker.Fake("Hübsch")); Assert.AreEqual("Tavit", faker.Fake("David")); Assert.AreEqual("Lientsh", faker.Fake("Lynch")); Assert.AreEqual("Djohnn", faker.Fake("John")); Assert.AreEqual("Hasstjon", faker.Fake("Huston")); Assert.AreEqual("Halphrit", faker.Fake("Alfred")); Assert.AreEqual("Frohrehr", faker.Fake("Vohrer")); Assert.AreEqual("Rittli", faker.Fake("Ridley")); Assert.AreEqual("Sgodt", faker.Fake("Scott")); Assert.AreEqual("Djohnn", faker.Fake("John")); Assert.AreEqual("Garbender", faker.Fake("Carpenter")); Assert.AreEqual("Ricaart", faker.Fake("Richard")); Assert.AreEqual("Turnnr", faker.Fake("Donner")); Assert.AreEqual("Aaralt", faker.Fake("Harald")); Assert.AreEqual("Raynl", faker.Fake("Reinl")); Assert.AreEqual("Gurt", faker.Fake("Kurt")); Assert.AreEqual("Offmahn", faker.Fake("Hoffmann")); Assert.AreEqual("Guij", faker.Fake("Guy")); Assert.AreEqual("Hamiltjon", faker.Fake("Hamilton")); Assert.AreEqual("Kregorih J.", faker.Fake("Gregory J.")); Assert.AreEqual("Pomen", faker.Fake("Bonann")); Assert.AreEqual("Praian", faker.Fake("Brian")); Assert.AreEqual("De Balna", faker.Fake("De Palma")); Assert.AreEqual("Zertshio", faker.Fake("Sergio")); Assert.AreEqual("Liohme", faker.Fake("Leone")); Assert.AreEqual("Frunnzis Fortt", faker.Fake("Francis Ford")); Assert.AreEqual("Gopbolla", faker.Fake("Coppola")); Assert.AreEqual("Gristian Slater", faker.Fake("Christian Slater")); //Assert.AreEqual( "Slaterrol", faker.Fake( "Slater" ) ); }
public static string Name() { return(string.Concat(NameFaker.FirstName(), " ", NameFaker.LastName())); }
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) }; }
/// <summary> /// Fakes the name. /// </summary> /// <returns></returns> public string FakeName() { return(NameFaker.Name()); }
public void SetUp() { _fakerContainer = A.Fake <IFakerContainer>(); _nameFaker = new NameFaker(_fakerContainer); }
/// <summary> /// Fakes the last name. /// </summary> /// <returns></returns> public string FakeLastName() { return(NameFaker.LastName()); }
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); } }