Esempio n. 1
0
        private string AdjustChallengeRating(string originalChallengeRating, int additionalHitDice, string creatureType)
        {
            var creatureTypeDivisor = typeAndAmountSelector.SelectOne(TableNameConstants.TypeAndAmount.Advancements, creatureType);
            var divisor             = creatureTypeDivisor.Amount;
            var advancementAmount   = additionalHitDice / divisor;

            return(ChallengeRatingConstants.IncreaseChallengeRating(originalChallengeRating, advancementAmount));
        }
        public void SelectASingleTypeAndAmount()
        {
            var entries = new[]
            {
                TypeAndAmountHelper.Build("type", "9266"),
                TypeAndAmountHelper.Build("other type", "90210"),
            };

            mockCollectionSelector.Setup(s => s.SelectFrom("table name", "name")).Returns(entries);

            SetUpRoll("9266", 42);

            var typeAndAmount = selector.SelectOne("table name", "name");

            Assert.That(typeAndAmount.Type, Is.EqualTo("type"));
            Assert.That(typeAndAmount.Amount, Is.EqualTo(42));
        }