Ejemplo n.º 1
0
        public void TestVariousPossibleNouns()
        {
            var  generator      = new IdentifiersGenerator(this.adjectives, this.animals, this.names, this.nationalities, this.nouns, this.professions);
            bool nounDone       = false;
            bool professionDone = false;
            bool animalDone     = false;

            for (int i = 0; i < 1000; i++)
            {
                var result = generator.Get(
                    IdentifierComponents.Adjective | IdentifierComponents.Nationality | IdentifierComponents.FirstName |
                    IdentifierComponents.Profession | IdentifierComponents.Noun | IdentifierComponents.Animal,
                    NameOrderingStyle.SilentBobStyle);
                if (result == "Sophisticated Albanian MountainGoat Helga")
                {
                    animalDone = true;
                }
                else if (result == "Sophisticated Albanian Toothpick Helga")
                {
                    nounDone = true;
                }
                else if (result == "Sophisticated Albanian Baker Helga")
                {
                    professionDone = true;
                }

                if (nounDone && professionDone && animalDone)
                {
                    return;
                }
            }
            Assert.Fail($"Noun: {nounDone}. Profession: {professionDone}. Animal {animalDone}");
        }
Ejemplo n.º 2
0
        public void TestSilentBobStyle()
        {
            var generator = new IdentifiersGenerator(this.adjectives, this.animals, this.names, this.nationalities, this.nouns, this.professions);

            Assert.AreEqual("Helga", generator.Get(IdentifierComponents.FirstName, NameOrderingStyle.SilentBobStyle));
            Assert.AreEqual("Toothpick Helga", generator.Get(IdentifierComponents.FirstName | IdentifierComponents.Noun, NameOrderingStyle.SilentBobStyle));
            Assert.AreEqual("MountainGoat Helga", generator.Get(IdentifierComponents.FirstName | IdentifierComponents.Animal, NameOrderingStyle.SilentBobStyle));
            Assert.AreEqual("Sophisticated MountainGoat Helga", generator.Get(IdentifierComponents.Adjective | IdentifierComponents.FirstName | IdentifierComponents.Animal, NameOrderingStyle.SilentBobStyle));
            Assert.AreEqual("Sophisticated Albanian MountainGoat Helga", generator.Get(IdentifierComponents.Adjective | IdentifierComponents.Nationality | IdentifierComponents.FirstName | IdentifierComponents.Animal, NameOrderingStyle.SilentBobStyle));
        }