Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            /// <summary>
            /// Generate Test User data for a number of Users
            /// by default for every user are added:
            ///  30 Contacts and 15 Meetings with Categories for each Contact
            /// </summary>

            GenerateTestData.GenerateUserData(20);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Generates Test User data for a number of Users
        /// by default for every user are added:
        /// 30 Contacts and 15 Meetings with Categories for each Contact
        /// </summary>
        /// <param name="numberOfUsers">The number of users for which test data will be generated</param>
        public static void GenerateUserData(int numberOfUsers)
        {
            for (int i = 0; i < numberOfUsers; i++)
            {
                string username = Faker.NameFaker.FirstName() + Faker.StringFaker.Alpha(3) + Faker.NumberFaker.Number(20);
                //we use the same username and password to ease the test authentication process
                User newUser = UserDAL.Create(username, username, Faker.StringFaker.Alpha(3) + Faker.InternetFaker.Email(), Faker.NameFaker.FirstName(), Faker.NameFaker.LastName());

                GenerateTestData.ContactsForUser(newUser, 30);
                GenerateTestData.CategoriesForUser(newUser, 5);
                GenerateTestData.MeetingsForUser(newUser, 15);
            }
        }