public void BleedDps() { var calculator = Calculator.Create(); var nodes = calculator.NodeRepository; calculator.NewBatchUpdate() .AddModifiers(_givenMods) .AddModifier(Build(_builderFactories.StatBuilders.CastRate.With(DamageSource.Attack)), Form.BaseSet, 2) .AddModifier(Build(_builderFactories.ActionBuilders.CriticalStrike.Chance), Form.BaseSet, 10) .AddModifier(Build(_builderFactories.EffectBuilders.Ailment.Bleed.Chance), Form.BaseSet, 10) .AddModifier(Build(_builderFactories.EffectBuilders.Ailment.Bleed.CriticalStrikesAlwaysInflict), Form.BaseSet, 1) .AddModifier(Build(_builderFactories.DamageTypeBuilders.Physical.DamageMultiplierWithCrits .With(_builderFactories.EffectBuilders.Ailment.Bleed)), Form.BaseAdd, 50) .DoUpdate(); var critChance = 0.1 * ChanceToHit(calculator); var ailmentChanceNonCrits = 0.1; var ailmentChanceCrits = 1; var baseDamage = 5 * 0.7; var nonCritDamage = baseDamage * EffectiveDamageMultiplierWithNonCrits; var critDamage = baseDamage * 0.4 * 1.2 * 2.25; var expected = (nonCritDamage * (1 - critChance) * ailmentChanceNonCrits + critDamage * critChance * ailmentChanceCrits) / ((1 - critChance) * ailmentChanceNonCrits + critChance * ailmentChanceCrits); var actual = nodes .GetNode(Build(_metaStats.AilmentDps(Ailment.Bleed)).Single()) .Value.Single(); Assert.AreEqual(expected, actual, 1e-10); }