public void PersonDataGeneratorConstructorTestWithOccupationList(ICollection <string> occupations, ICollection <string> firstNamesMale, ICollection <string> firstNamesFelmale, ICollection <string> lastNames)
        {
            PersonDataGenerator pdg = new PersonDataGenerator(occupations, firstNamesMale, firstNamesFelmale, lastNames);

            TestHelpper.PrintPersonDataGeneratorDataLists(pdg);
            Assert.IsTrue(pdg.occupations != null && pdg.firstNamesMale != null && pdg.firstNamesFemale != null && pdg.lastNames != null);
        }
예제 #2
0
        public void GetRandomPersonWithAge()
        {
            Person rndPerson = testDataGenerator.GenerateRandomPerson(age: 66);

            TestHelpper.PrintPersonData(rndPerson);
            Assert.IsTrue(rndPerson.age == 66);
        }
예제 #3
0
        public void GenerateRandomPersonWithGenderMale()
        {
            Person person;

            TestContext.WriteLine("Randomized sex");
            for (int i = 0; i < 10; i++)
            {
                person = testDataGenerator.GenerateRandomPerson(sex: Person.Sex.Randomize);
                TestHelpper.PrintPersonData(person);
            }

            TestContext.WriteLine("\nMales");
            for (int i = 0; i < 10; i++)
            {
                person = testDataGenerator.GenerateRandomPerson(sex: Person.Sex.Male);
                TestHelpper.PrintPersonData(person);
            }

            TestContext.WriteLine("\n Females");
            for (int i = 0; i < 10; i++)
            {
                person = testDataGenerator.GenerateRandomPerson(sex: Person.Sex.Female);
                TestHelpper.PrintPersonData(person);
            }
        }
예제 #4
0
        public void GetRandomFromIListTest()
        {
            List <Person> people    = testDataGenerator.GetListOfRandomPersons(100);
            Person        rndPerson = testDataGenerator.GetRandomFromIList(people);

            TestHelpper.PrintPersonData(rndPerson);

            Assert.IsTrue(rndPerson != null && people.Count == 100);
        }
예제 #5
0
        public void GeneratePersonWithTemplateAge()
        {
            Person templatePerson = new Person();

            templatePerson.age = 88;
            Person people = testDataGenerator.GenerateRandomPerson(templatePerson);

            TestHelpper.PrintPersonData(people);
            Assert.IsTrue(people.age == 88);
        }
예제 #6
0
        public void GeneratePersonsWithTemplateSex()
        {
            Person templatePerson = new Person();

            templatePerson.sex = Person.Sex.Male;
            Person people = testDataGenerator.GenerateRandomPerson(templatePerson);

            TestHelpper.PrintPersonData(people);
            Assert.IsTrue(people.sex == Person.Sex.Male);
        }
예제 #7
0
        public void GeneratePersonWithTemplateLastName()
        {
            Person templatePerson = new Person();

            templatePerson.lastName = "Mustaine";
            Person people = testDataGenerator.GenerateRandomPerson(templatePerson);

            TestHelpper.PrintPersonData(people);
            Assert.IsTrue(people.lastName == "Mustaine");
        }
예제 #8
0
        public void GeneratePersonWithTemplateFirstName()
        {
            Person templatePerson = new Person();

            templatePerson.firstName = "Heikki";
            Person people = testDataGenerator.GenerateRandomPerson(templatePerson);

            TestHelpper.PrintPersonData(people);
            Assert.IsTrue(people.firstName == "Heikki");
        }
예제 #9
0
        public void GenerateListOfPersons()
        {
            List <Person> people = testDataGenerator.GetListOfRandomPersons(100);

            foreach (Person person in people)
            {
                TestHelpper.PrintPersonData(person);
            }

            Assert.IsTrue(people.Count == 100);
        }
예제 #10
0
        public void GenerateNumerOfRandomPersons()
        {
            Person person;

            for (int i = 0; i < 100; i++)
            {
                person = testDataGenerator.GenerateRandomPerson();
                TestHelpper.PrintPersonData(person);
            }
            Assert.Pass();
        }
예제 #11
0
        public void GenerateRandomPersonInsertedLastNameTest()
        {
            List <Person> people = new List <Person>();
            Person        person;

            for (int i = 0; i < 50; i++)
            {
                person = testDataGenerator.GenerateRandomPerson(lastName: "TestLastName");
                people.Add(person);
                TestHelpper.PrintPersonData(person);
            }
            Assert.IsTrue(people.Count == 50);
        }
예제 #12
0
        public void GeneratePersonListWithTemplate()
        {
            Person templatePerson = new Person();

            templatePerson.age      = 88;
            templatePerson.lastName = "Mustonen";
            List <Person> people = testDataGenerator.GetListOfRandomPersons(100, templatePerson);

            TestContext.WriteLine("\n Age should be 88 and lastName should be Mustonen");
            foreach (Person person in people)
            {
                TestHelpper.PrintPersonData(person);
            }
            Assert.IsTrue(people.Count == 100);
        }