Пример #1
0
 public void TextFakerTest()
 {
     DisplayAndExecute(new Expression <Func <string> >[] {
         () => TextFaker.Sentence(),
         () => TextFaker.Sentences(4),
     });
 }
Пример #2
0
        private Article CreateRandomArticle()
        {
            var result = new Article();

            result.Body        = TextFaker.Sentences(NumberFaker.Number());
            result.Description = TextFaker.Sentence();
            result.Id          = NumberFaker.Number().ToString();
            result.Title       = TextFaker.Sentence();

            return(result);
        }
Пример #3
0
        public IEnumerable <Article> GetArticles()
        {
            var result = new Article();

            result.Body        = TextFaker.Sentences(NumberFaker.Number());
            result.Description = TextFaker.Sentence();
            result.Id          = NumberFaker.Number().ToString();
            result.Title       = TextFaker.Sentence();


            List <Article> list = new List <Article>();

            for (var i = 0; i < 100; i++)
            {
                list.Add(CreateRandomArticle());
            }


            return(list);
        }
Пример #4
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)
            };
        }
Пример #5
0
 /// <summary>
 /// Fakes the sentence.
 /// </summary>
 /// <returns></returns>
 public string FakeSentence()
 {
     return(TextFaker.Sentence());
 }