예제 #1
0
        public void BuildDataIntoArray_WithEmptyDamageData()
        {
            var data = helper.BuildData(
                "attack name",
                string.Empty,
                "damage effect",
                92.66,
                "attack type",
                90210,
                "time period",
                true,
                true,
                true,
                true);

            Assert.That(data[DataIndexConstants.AttackData.NameIndex], Is.EqualTo("attack name"));
            Assert.That(data[DataIndexConstants.AttackData.DamageDataIndex], Is.Empty);
            Assert.That(data[DataIndexConstants.AttackData.DamageEffectIndex], Is.EqualTo("damage effect"));
            Assert.That(data[DataIndexConstants.AttackData.DamageBonusMultiplierIndex], Is.EqualTo(92.66.ToString()));
            Assert.That(data[DataIndexConstants.AttackData.AttackTypeIndex], Is.EqualTo("attack type"));
            Assert.That(data[DataIndexConstants.AttackData.FrequencyQuantityIndex], Is.EqualTo(90210.ToString()));
            Assert.That(data[DataIndexConstants.AttackData.FrequencyTimePeriodIndex], Is.EqualTo("time period"));
            Assert.That(data[DataIndexConstants.AttackData.IsMeleeIndex], Is.EqualTo(true.ToString()));
            Assert.That(data[DataIndexConstants.AttackData.IsNaturalIndex], Is.EqualTo(true.ToString()));
            Assert.That(data[DataIndexConstants.AttackData.IsPrimaryIndex], Is.EqualTo(true.ToString()));
            Assert.That(data[DataIndexConstants.AttackData.IsSpecialIndex], Is.EqualTo(true.ToString()));
            Assert.That(data[DataIndexConstants.AttackData.SaveAbilityIndex], Is.Empty);
            Assert.That(data[DataIndexConstants.AttackData.SaveIndex], Is.Empty);
            Assert.That(data[DataIndexConstants.AttackData.SaveDcBonusIndex], Is.EqualTo(0.ToString()));
            Assert.That(data.Length, Is.EqualTo(14));
        }
예제 #2
0
        public void FromData_ReturnsSelection_WithNoDamage()
        {
            var data    = attackHelper.BuildData("name", string.Empty, "effect", 4.2, "attack type", 9266, "time period", true, true, true, true, string.Empty, string.Empty);
            var rawData = attackHelper.BuildEntry(data);

            var selection = AttackSelection.From(rawData);

            Assert.That(selection.AttackType, Is.EqualTo("attack type"));
            Assert.That(selection.Damages, Is.Empty);
            Assert.That(selection.DamageEffect, Is.EqualTo("effect"));
            Assert.That(selection.DamageBonusMultiplier, Is.EqualTo(4.2));
            Assert.That(selection.FrequencyQuantity, Is.EqualTo(9266));
            Assert.That(selection.FrequencyTimePeriod, Is.EqualTo("time period"));
            Assert.That(selection.IsMelee, Is.True);
            Assert.That(selection.IsNatural, Is.True);
            Assert.That(selection.IsPrimary, Is.True);
            Assert.That(selection.IsSpecial, Is.True);
            Assert.That(selection.Name, Is.EqualTo("name"));
            Assert.That(selection.Save, Is.Empty);
            Assert.That(selection.SaveAbility, Is.Empty);
            Assert.That(selection.SaveDcBonus, Is.Zero);
        }