public void MundaneCloneIsSuccessful() { var name = Guid.NewGuid().ToString(); var template = itemVerifier.CreateRandomArmorTemplate(name); template.ItemType = Guid.NewGuid().ToString(); template.Magic.SpecialAbilities = new[] { new SpecialAbility { Name = Guid.NewGuid().ToString() }, new SpecialAbility { Name = Guid.NewGuid().ToString() } }; template.Attributes = new[] { Guid.NewGuid().ToString(), Guid.NewGuid().ToString() }; template.ArmorBonus = 9266; template.ArmorCheckPenalty = -90210; template.MaxDexterityBonus = 42; template.Size = "massive"; var clone = template.MundaneClone(); itemVerifier.AssertMundaneItemFromTemplate(clone, template); Assert.That(clone.ItemType, Is.EqualTo(template.ItemType)); Assert.That(clone.Attributes, Is.EquivalentTo(template.Attributes)); Assert.That(clone.Magic.SpecialAbilities, Is.Empty); var cloneArmor = clone as Armor; Assert.That(cloneArmor.ArmorBonus, Is.EqualTo(template.ArmorBonus)); Assert.That(cloneArmor.ArmorCheckPenalty, Is.EqualTo(template.ArmorCheckPenalty)); Assert.That(cloneArmor.MaxDexterityBonus, Is.EqualTo(template.MaxDexterityBonus)); Assert.That(cloneArmor.Size, Is.EqualTo(template.Size)); }
public void MundaneCloneIsSuccessful() { var name = Guid.NewGuid().ToString(); var template = itemVerifier.CreateRandomWeaponTemplate(name); template.ItemType = Guid.NewGuid().ToString(); template.Magic.SpecialAbilities = new[] { new SpecialAbility { Name = Guid.NewGuid().ToString() }, new SpecialAbility { Name = Guid.NewGuid().ToString() } }; template.Attributes = new[] { Guid.NewGuid().ToString(), Guid.NewGuid().ToString() }; template.Damages.Add(new Damage { Roll = "a ton", Type = "stabbing" }); template.Damages.Add(new Damage { Roll = "a bit", Type = "emotional" }); template.CriticalDamages.Add(new Damage { Roll = "a ton more", Type = "stabbing" }); template.CriticalDamages.Add(new Damage { Roll = "a bit more", Type = "spiritual" }); template.SecondaryDamages.Add(new Damage { Roll = "some", Type = "whacking" }); template.SecondaryDamages.Add(new Damage { Roll = "partial", Type = "mental" }); template.SecondaryCriticalDamages.Add(new Damage { Roll = "some more", Type = "whacking" }); template.SecondaryCriticalDamages.Add(new Damage { Roll = "partial more", Type = "psychic" }); template.Size = "massive"; template.Ammunition = "nerf bullets"; template.SecondaryMagicBonus = 90210; template.SecondaryHasAbilities = true; template.SecondaryCriticalMultiplier = "sevenfold"; var clone = template.MundaneClone(); itemVerifier.AssertMundaneItemFromTemplate(clone, template); Assert.That(clone.ItemType, Is.EqualTo(template.ItemType)); Assert.That(clone.Attributes, Is.EquivalentTo(template.Attributes)); Assert.That(clone.Magic.SpecialAbilities, Is.Empty); var cloneWeapon = clone as Weapon; Assert.That(cloneWeapon.Ammunition, Is.Not.Empty.And.EqualTo(template.Ammunition)); Assert.That(cloneWeapon.DamageRoll, Is.Not.Empty.And.EqualTo(string.Join("+", template.Damages.Select(d => d.Roll)))); Assert.That(cloneWeapon.DamageDescription, Is.Not.Empty.And.EqualTo(string.Join(" + ", template.Damages.Select(d => d.Description)))); Assert.That(cloneWeapon.CriticalDamageRoll, Is.Not.Empty.And.EqualTo(string.Join("+", template.CriticalDamages.Select(d => d.Roll)))); Assert.That(cloneWeapon.CriticalDamageDescription, Is.Not.Empty.And.EqualTo(string.Join(" + ", template.CriticalDamages.Select(d => d.Description)))); Assert.That(cloneWeapon.SecondaryDamageRoll, Is.Not.Empty.And.EqualTo(string.Join("+", template.SecondaryDamages.Select(d => d.Roll)))); Assert.That(cloneWeapon.SecondaryDamageDescription, Is.Not.Empty.And.EqualTo(string.Join(" + ", template.SecondaryDamages.Select(d => d.Description)))); Assert.That(cloneWeapon.SecondaryCriticalDamageRoll, Is.Not.Empty.And.EqualTo(string.Join("+", template.SecondaryCriticalDamages.Select(d => d.Roll)))); Assert.That(cloneWeapon.SecondaryCriticalDamageDescription, Is.Not.Empty.And.EqualTo(string.Join(" + ", template.SecondaryCriticalDamages.Select(d => d.Description)))); Assert.That(cloneWeapon.Size, Is.Not.Empty.And.EqualTo(template.Size)); Assert.That(cloneWeapon.ThreatRangeDescription, Is.Not.Empty.And.EqualTo(template.ThreatRangeDescription)); Assert.That(cloneWeapon.ThreatRange, Is.Not.Zero.And.EqualTo(template.ThreatRange)); Assert.That(cloneWeapon.CriticalMultiplier, Is.Not.Empty.And.EqualTo(template.CriticalMultiplier)); Assert.That(cloneWeapon.SecondaryCriticalMultiplier, Is.Not.Empty.And.EqualTo(template.SecondaryCriticalMultiplier)); Assert.That(cloneWeapon.SecondaryMagicBonus, Is.Zero); Assert.That(cloneWeapon.SecondaryHasAbilities, Is.False); }