public void ShouldReturnAsText() { //arrange AttributeScore score1 = new AttributeScore(6); //assert score1.AsText().Should().Be(new TextObj("6")); }
public void Modifier_WhenAttributeScoreIs12_ThenModifierIsOne() { var stat = new AttributeScore(12); var modifier = stat.Modifier; Assert.AreEqual(1, modifier); }
public void Modifier_WhenAttributeScoreIs2_ThenModifierIsMinusFour() { var stat = new AttributeScore(8); var modifier = stat.Modifier; Assert.AreEqual(-1, modifier); }
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(); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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()); }