public async Task <IActionResult> Edit(int id, [Bind("Persuasionid,Persausionprof")] Persuasion persuasion)
        {
            if (id != persuasion.Persuasionid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(persuasion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersuasionExists(persuasion.Persuasionid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(persuasion));
        }
        public void ShouldReturnName()
        {
            //assign
            ISkill actualSkillBase = new Persuasion();
            //act
            ITextObj name = actualSkillBase.Name();

            //assert
            name.Should().Be(new TextObj("Persuasion"));
        }
Exemple #3
0
        public void Bonus_PersuasionSpecified_ShouldWork()
        {
            SetupCharacter();

            Skills persuasion = new Persuasion(true, true);

            Assert.AreEqual(-5, persuasion.Bonus);
            Assert.IsTrue(persuasion.Proficiency);
            Assert.IsTrue(persuasion.Expertise);
        }
        public void ShouldReturnBaseAttribute()
        {
            //arrange
            ISkill skill = new Persuasion();
            ICharacterAttribute charismaAttribute = new CharismaAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(charismaAttribute);
        }
        public async Task <IActionResult> Create([Bind("Persuasionid,Persausionprof")] Persuasion persuasion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(persuasion);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(persuasion));
        }
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            CharismaAttribute dexterityAttribute = new CharismaAttribute(new AttributeScore(14));
            ISkill            persuasion         = new Persuasion(dexterityAttribute);
            IAttributeScore   expectedScore      = new AttributeScore(2);
            //act
            IAttributeScore actualScore = persuasion.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
    public void UpdateUI()
    {
        HealthText.text      = NewPlayer.Health.ToString();
        StaminaText.text     = NewPlayer.Stamina.ToString();
        ManaText.text        = NewPlayer.Mana.ToString();
        StrenghText.text     = NewPlayer.Strenght.ToString();
        SkillText.text       = NewPlayer.Skill.ToString();
        KnowledgeText.text   = NewPlayer.Knowledge.ToString();
        StatsPointsText.text = StatsPoints.ToString();
        PlayerLevelText.text = NewPlayer.PlayerLevel.ToString();

        Texts1[0].text = NewPlayer.Health.ToString();
        Texts1[1].text = NewPlayer.Stamina.ToString();
        Texts1[2].text = NewPlayer.Mana.ToString();
        Texts1[3].text = NewPlayer.Strenght.ToString();
        Texts1[4].text = NewPlayer.Skill.ToString();
        Texts1[5].text = NewPlayer.Knowledge.ToString();

        Texts2[0].text = NewPlayer.Health.ToString();
        Texts2[1].text = NewPlayer.Stamina.ToString();
        Texts2[2].text = NewPlayer.Mana.ToString();
        Texts2[3].text = NewPlayer.Strenght.ToString();
        Texts2[4].text = NewPlayer.Skill.ToString();
        Texts2[5].text = NewPlayer.Knowledge.ToString();

        Texts3[0].text  = HealthPoints.ToString();
        Texts3[1].text  = StaminaPoints.ToString();
        Texts3[2].text  = ManaPoints.ToString();
        Texts3[3].text  = Weapon1Dam.ToString();
        Texts3[4].text  = Weapon2Dam.ToString();
        Texts3[5].text  = Weight.ToString();
        Texts3[6].text  = PhysicDEF.ToString();
        Texts3[7].text  = FireDEF.ToString();
        Texts3[8].text  = EletricDEF.ToString();
        Texts3[9].text  = PoisonDEF.ToString();
        Texts3[12].text = MagicDEF.ToString();
        Texts3[10].text = Awarness.ToString();
        Texts3[11].text = Persuasion.ToString();
    }