Exemplo n.º 1
0
 public void StringFakerTest()
 {
     DisplayAndExecute(new Expression <Func <string> >[] {
         () => StringFaker.Alpha(5),
         () => StringFaker.AlphaNumeric(5),
         () => StringFaker.Numeric(5),
         () => StringFaker.Randomize("### ??"),
     });
 }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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()
            };
        }
Exemplo n.º 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)
            };
        }