Exemplo n.º 1
0
        public void createFilled_CompleteTest_DisAdvantage()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = (random.Next(maxGP)).ToString();
            String Value       = (random.Next(maxValue)).ToString();

            Feature feature = new Feature("Test", "Test", "Test", "Test", DSA_FEATURES.NACHTEIL);

            feature.setGP(GP);
            feature.setName(Name);
            feature.setValue(Value);
            feature.setDescription(Description);

            setAdvancedValues(feature);
            setAttributValues(feature);
            setEnergieValues(feature);

            Assert.AreEqual(GP, feature.getGP());
            Assert.AreEqual(Name, feature.getName());
            Assert.AreEqual(Value, feature.getValue());
            Assert.AreEqual(Description, feature.getSimpleDescription());
            Assert.AreEqual(getDescription(feature.getFeatureType(), Description), feature.getDescription());

            checkAdvancedValues(feature);
            checkAttributValues(feature);
            checkEnergieValues(feature);
        }
Exemplo n.º 2
0
        public void DescriptionWithTalent()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = "GP" + RandomGenerator.generateName();
            String Value       = (random.Next(maxValue)).ToString();

            Feature AD_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.NACHTEIL);

            TalentCrafting testTalent = new TalentCrafting("CraftingTalent", new List <DSA_ATTRIBUTE>(), "", new List <TalentDeviate>(), new List <TalentRequirement>());

            AD_feature.addTalent(testTalent, 10);
            DI_feature.addTalent(testTalent, 10);

            setAttributValues(AD_feature);
            setAttributValues(DI_feature);

            setEnergieValues(AD_feature);
            setEnergieValues(DI_feature);

            setAdvancedValues(AD_feature);
            setAdvancedValues(DI_feature);

            String ADDescription = (getDescription(DSA_FEATURES.VORTEIL, Description)) + ", CraftingTalent(10)";
            String DIDescription = (getDescription(DSA_FEATURES.NACHTEIL, Description)) + ", CraftingTalent(-10)";

            Assert.AreEqual(ADDescription, AD_feature.getDescription());
            Assert.AreEqual(DIDescription, DI_feature.getDescription());
        }
        public void testMotherMark_RandomString_notEmpty()
        {
            LanguageAbstractTalent talent = getLanguageAbstractTalentWithDeviateRequirement();

            talent.setMotherMark(RandomGenerator.generateName());

            String.Compare("X", talent.getMotherMark());
        }
Exemplo n.º 4
0
        public void createFilled_getValue_NotNumeric()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = "GP" + RandomGenerator.generateName();
            String Value       = "Value" + RandomGenerator.generateName();


            Feature AD_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.NACHTEIL);

            Assert.AreEqual("", AD_feature.getValue());
            Assert.AreEqual("", DI_feature.getValue());
        }
Exemplo n.º 5
0
        public void createFilled_getValue_Numeric()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = (random.Next(maxGP)).ToString();
            String Value       = (random.Next(maxValue)).ToString();


            Feature AD_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.NACHTEIL);

            Assert.AreEqual(Value, AD_feature.getValue());
            Assert.AreEqual(Value, DI_feature.getValue());
        }
Exemplo n.º 6
0
        public void createBasic_getValue()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = "GP" + RandomGenerator.generateName();
            String Value       = (random.Next(maxValue)).ToString();


            Feature AD_feature = new Feature(DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(DSA_FEATURES.NACHTEIL);

            Assert.AreEqual("", AD_feature.getValue());
            Assert.AreEqual("", DI_feature.getValue());
        }
        public void testStringComplex()
        {
            Random        random = new Random();
            List <String> ret    = new List <String>(0);
            int           x      = random.Next(maxComplexCount);

            for (int i = 0; i < x; i++)
            {
                ret.Add(RandomGenerator.generateName());
            }
            BE = ret;
            LanguageAbstractTalent talent = getLanguageAbstractTalentWithDeviateRequirement();

            Assert.AreEqual(getBEString(), talent.getBe());
        }
Exemplo n.º 8
0
        public void TalentValueUnknownTalent()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = "GP" + RandomGenerator.generateName();
            String Value       = (random.Next(maxValue)).ToString();

            Feature AD_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.NACHTEIL);

            TalentCrafting testTalent = new TalentCrafting("", new List <DSA_ATTRIBUTE>(), "", new List <TalentDeviate>(), new List <TalentRequirement>());

            Assert.AreEqual(0, AD_feature.getTaWBonus(testTalent));
            Assert.AreEqual(0, DI_feature.getTaWBonus(testTalent));
        }
Exemplo n.º 9
0
        public void createFilled_getAdvantage()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = "GP" + RandomGenerator.generateName();
            String Value       = (random.Next(maxValue)).ToString();

            Feature AD_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.NACHTEIL);

            setAdvancedValues(AD_feature);
            setAdvancedValues(DI_feature);

            checkAdvancedValues(AD_feature);
            checkAdvancedValues(DI_feature);
        }
Exemplo n.º 10
0
        public void setUPTalentFighting()
        {
            Random random = new Random();

            BE              = "BE_" + RandomGenerator.generateName();
            diverateList    = generateTestDeviates();
            requirementList = new List <TalentRequirement>(0);

            int enumlenght = Enum.GetNames(typeof(DSA_ADVANCEDVALUES)).Length;
            int x          = random.Next(enumlenght);

            advancedvalue = (DSA_ADVANCEDVALUES)enumlenght;
            parade        = true;

            at = 0;
            pa = 0;
        }
Exemplo n.º 11
0
        internal List <TalentDeviate> generateTestDeviates()
        {
            List <TalentDeviate> deviateList = new List <TalentDeviate>(0);

            for (int i = 0; i < random.Next(minCountDeviates, maxCountDeviates); i++)
            {
                String name = "Deviate_Talent_" + i + "_" + RandomGenerator.generateName();
                List <DSA_ATTRIBUTE> atl = RandomGenerator.generateAttributList();
                String be = "Be_Deviate_" + RandomGenerator.generateName();

                InterfaceTalent DeviateTestTalent = new TalentCrafting(name, atl, be, new List <TalentDeviate>(0), new List <TalentRequirement>(0));
                TalentDeviate   talentDeviate     = new TalentDeviate(name, random.Next(minDeviateTaW, maxDeviateTaW));

                deviateList.Add(talentDeviate);
                charakter.addTalent(DeviateTestTalent);
            }
            return(deviateList);
        }
Exemplo n.º 12
0
        internal List <TalentRequirement> generateTestRequirements()
        {
            List <TalentRequirement> requirementList = new List <TalentRequirement>(0);

            for (int i = 0; i < random.Next(maxCountRequiremnts); i++)
            {
                String name = "Requirement_Talent" + RandomGenerator.generateName();
                List <DSA_ATTRIBUTE> at1 = RandomGenerator.generateAttributList();
                String be = "Be_Deviate_" + RandomGenerator.generateName();

                InterfaceTalent   DeviateTestTalent = new TalentCrafting(name, at1, be, new List <TalentDeviate>(0), new List <TalentRequirement>(0));
                TalentRequirement talentRequirement = new TalentRequirement(name, random.Next(maxRequirementTaW), maxRequirmentTaWat);

                requirementList.Add(talentRequirement);
                charakter.addTalent(DeviateTestTalent);
            }

            return(requirementList);
        }
Exemplo n.º 13
0
        public void createFilled_gedComplexDescription()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = "GP" + RandomGenerator.generateName();
            String Value       = (random.Next(maxValue)).ToString();

            Feature AD_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.NACHTEIL);

            setAttributValues(AD_feature);
            setEnergieValues(AD_feature);
            setAdvancedValues(AD_feature);

            setAttributValues(DI_feature);
            setEnergieValues(DI_feature);
            setAdvancedValues(DI_feature);

            Assert.AreEqual(Description, AD_feature.getSimpleDescription());
            Assert.AreEqual(Description, DI_feature.getSimpleDescription());

            Assert.AreEqual(getDescription(DSA_FEATURES.VORTEIL, Description), AD_feature.getDescription());
            Assert.AreEqual(getDescription(DSA_FEATURES.NACHTEIL, Description), DI_feature.getDescription());
        }
Exemplo n.º 14
0
 public void setUPTalentTest()
 {
     charakter  = RandomGenerator.generateCharacter();
     TalentName = "Talent_" + RandomGenerator.generateName();
 }
Exemplo n.º 15
0
 public void setUPGeneralTest()
 {
     requirementList = this.generateTestRequirements();
     deviateList     = this.generateTestDeviates();
     BE = "BE_" + RandomGenerator.generateName();
 }