Exemplo n.º 1
0
        public void SetUp()
        {
            _fakerContainer = A.Fake <IFakerContainer>();
            _internetFaker  = new InternetFaker(_fakerContainer);

            A.CallTo(() => _fakerContainer.Fake).Returns(new FakeFaker(_fakerContainer));
        }
Exemplo n.º 2
0
 public void InternetFakerTest()
 {
     DisplayAndExecute(new Expression <Func <string> >[] {
         () => InternetFaker.Domain(),
         () => InternetFaker.Email(),
         () => InternetFaker.Url()
     });
 }
Exemplo n.º 3
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()));
 }
Exemplo n.º 4
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);
 }
Exemplo n.º 5
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)
            };
        }
Exemplo n.º 6
0
 public static string Url()
 {
     return(string.Concat("http://www.", InternetFaker.Domain()));
 }