public void ShouldReturnAsText()
 {
     //arrange
     AttributeScore score1 = new AttributeScore(6);
     //assert
     score1.AsText().Should().Be(new TextObj("6"));
 }
Exemplo n.º 2
0
        public void Modifier_WhenAttributeScoreIs12_ThenModifierIsOne()
        {
            var stat = new AttributeScore(12);

            var modifier = stat.Modifier;

            Assert.AreEqual(1, modifier);
        }
Exemplo n.º 3
0
        public void Modifier_WhenAttributeScoreIs2_ThenModifierIsMinusFour()
        {
            var stat = new AttributeScore(8);

            var modifier = stat.Modifier;

            Assert.AreEqual(-1, modifier);
        }
Exemplo n.º 4
0
 public Player()
     : base(id: string.Empty, name: string.Empty, race: string.Empty, entityClass: string.Empty, type: nameof(Player), new Position(), new Statistics())
 {
     Level = new AttributeScore {
         Base = 0
     };
     Inventory = new Inventory();
 }
Exemplo n.º 5
0
 public Player(string id, string name, string race, string entityClass, int level, Statistics statistics)
     : base(id, name, race, entityClass, type: nameof(Player), new Position(), statistics)
 {
     Level = new AttributeScore {
         Base = level
     };
     Inventory = new Inventory();
 }
        public void ShouldNotEquate()
        {
            //arrange
            IAttributeScore score1 = new AttributeScore(4);
            IAttributeScore score2 = new AttributeScore(8);

            //assert
            score2.Should().NotBe(score1);
        }
 public void ShouldAdd()
 {
     //arrange
     AttributeScore score1 = new AttributeScore(4);
     AttributeScore score2 = new AttributeScore(8);
     IAttributeScore totalScore = new AttributeScore(12);
     IAttributeScore actualScore = score1.Add(score2);
     //assert
     totalScore.Should().Be(actualScore);
 }
 public void ShouldSubtract()
 {
     //arrange
     AttributeScore score1 = new AttributeScore(6);
     AttributeScore score2 = new AttributeScore(8);
     IAttributeScore totalScore = new AttributeScore(2);
     IAttributeScore actualScore = score2.Subtract(score1);
     //assert
     totalScore.Should().Be(actualScore);
 }
Exemplo n.º 9
0
        public void ShouldReturnActiveSkillBonus()
        {
            //arrange
            ISkill         expectedSkillBase = new Deception(new CharismaAttribute(new AttributeScore(14)), true);
            AttributeScore score             = new AttributeScore(4);
            //act
            IAttributeScore actualScore = expectedSkillBase.SkillBonus();

            //assert
            actualScore.Should().Be(score);
        }
Exemplo n.º 10
0
        public void ShouldSetScore()
        {
            //arrange
            ICharacterAttribute attribute     = new DexterityAttribute(new AttributeScore(10));
            IAttributeScore     expectedScore = new AttributeScore(14);

            //act
            attribute.Set(expectedScore);
            //assert
            attribute.Score().Should().Be(expectedScore);
        }
Exemplo n.º 11
0
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            WisdomAttribute wisdomAttribute = new WisdomAttribute(new AttributeScore(14));
            ISkill          insight         = new Insight(wisdomAttribute);
            IAttributeScore expectedScore   = new AttributeScore(2);
            //act
            IAttributeScore actualScore = insight.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            CharismaAttribute charismaAttribute = new CharismaAttribute(new AttributeScore(14));
            ISkill            deception         = new Deception(charismaAttribute, false);
            IAttributeScore   expectedScore     = new AttributeScore(2);
            //act
            IAttributeScore actualScore = deception.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            CharismaAttribute dexterityAttribute = new CharismaAttribute(new AttributeScore(14));
            ISkill            intimidation       = new Intimidation(dexterityAttribute);
            IAttributeScore   expectedScore      = new AttributeScore(2);
            //act
            IAttributeScore actualScore = intimidation.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            IntellegenceAttribute intellegenceAttribute = new IntellegenceAttribute(new AttributeScore(14));
            ISkill          investigation = new Investigation(intellegenceAttribute);
            IAttributeScore expectedScore = new AttributeScore(2);
            //act
            IAttributeScore actualScore = investigation.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            CharismaAttribute dexterityAttribute = new CharismaAttribute(new AttributeScore(14));
            ISkill            performance        = new Performance(dexterityAttribute);
            IAttributeScore   expectedScore      = new AttributeScore(2);
            //act
            IAttributeScore actualScore = performance.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
Exemplo n.º 16
0
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            DexterityAttribute dexterityAttribute = new DexterityAttribute(new AttributeScore(14));
            ISkill             acrobatics         = new Acrobatics(dexterityAttribute);
            IAttributeScore    expectedScore      = new AttributeScore(2);
            //act
            IAttributeScore actualScore = acrobatics.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            IntellegenceAttribute intellegenceAttribute = new IntellegenceAttribute(new AttributeScore(14));
            ISkill          history       = new History(intellegenceAttribute);
            IAttributeScore expectedScore = new AttributeScore(2);
            //act
            IAttributeScore actualScore = history.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
Exemplo n.º 18
0
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            DexterityAttribute dexterityAttribute = new DexterityAttribute(new AttributeScore(14));
            ISkill             sleightOfHand      = new SleightOfHand(dexterityAttribute);
            IAttributeScore    expectedScore      = new AttributeScore(2);
            //act
            IAttributeScore actualScore = sleightOfHand.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
Exemplo n.º 19
0
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            StrengthAttribute strengthAttribute = new StrengthAttribute(new AttributeScore(14));
            ISkill            athletics         = new Athletics(strengthAttribute);
            IAttributeScore   expectedScore     = new AttributeScore(2);
            //act
            IAttributeScore actualScore = athletics.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
Exemplo n.º 20
0
        public void ShouldReturnAttributeBonus()
        {
            //arrange
            ICharacterAttribute attribute = new DexterityAttribute(new AttributeScore(1));
            IAttributeScore     expectedAttributeBonus = new AttributeScore(-5);

            //act
            IAttributeScore actualAttributeBonus = attribute.Bonus();

            //assert
            actualAttributeBonus.Should().Be(expectedAttributeBonus);
        }
Exemplo n.º 21
0
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            WisdomAttribute wisdomAttribute = new WisdomAttribute(new AttributeScore(14));
            ISkill          animalHandling  = new AnimalHandling(wisdomAttribute);
            IAttributeScore expectedScore   = new AttributeScore(2);
            //act
            IAttributeScore actualScore = animalHandling.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
Exemplo n.º 22
0
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            WisdomAttribute wisdomAttribute = new WisdomAttribute(new AttributeScore(14));
            ISkill          perception      = new Perception(wisdomAttribute);
            IAttributeScore expectedScore   = new AttributeScore(2);
            //act
            IAttributeScore actualScore = perception.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
Exemplo n.º 23
0
        public void ShouldReturnJsonObject()
        {
            //arrange
            ICharacterAttribute attribute     = new DexterityAttribute(new AttributeScore(10));
            IAttributeScore     expectedScore = new AttributeScore(14);
            string        expectedJson        = "{\"characterAttribute\":\"DEX\",\"value\":10}";
            StringBuilder sb = new StringBuilder();

            //act
            attribute.AddJsonToStringbuilder(sb);
            //assert
            sb.ToString().Should().Be(expectedJson);
        }
Exemplo n.º 24
0
        public void ShouldApplyRacialBonusToAttributes()
        {
            //arrange
            AttributeScore expectedDexterityScore = new AttributeScore(12);
            AttributeScore expectedWisdomScore    = new AttributeScore(11);

            _characterSheet = new CharacterSheet(new Fighter(), new WoodElf(), _attributeSet);
            //assert
            _characterSheet.Attribute(CharacterAttributeName.Strength).Score().Should().Be(new FakeAttribute().Score());

            _characterSheet.Attribute(CharacterAttributeName.Dexterity).Score().Should().Be(expectedDexterityScore);
            _characterSheet.Attribute(CharacterAttributeName.Constitution).Score().Should().Be(new FakeAttribute().Score());
            _characterSheet.Attribute(CharacterAttributeName.Intelligence).Score().Should().Be(new FakeAttribute().Score());
            _characterSheet.Attribute(CharacterAttributeName.Wisdom).Score().Should().Be(expectedWisdomScore);
            _characterSheet.Attribute(CharacterAttributeName.Charisma).Score().Should().Be(new FakeAttribute().Score());
        }