public void SmartCloneIsSuccessful() { var name = Guid.NewGuid().ToString(); var template = itemVerifier.CreateRandomArmorTemplate(name); template.ItemType = 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.SmartClone(); itemVerifier.AssertMagicalItemFromTemplate(clone, template); Assert.That(clone.ItemType, Is.EqualTo(template.ItemType)); Assert.That(clone.Attributes, Is.EquivalentTo(template.Attributes)); 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 SmartCloneIsSuccessful() { var name = Guid.NewGuid().ToString(); var template = itemVerifier.CreateRandomWeaponTemplate(name); template.ItemType = 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.Ammunition = "nerf bullets"; template.Size = "massive"; template.SecondaryMagicBonus = 90210; template.SecondaryHasAbilities = true; template.SecondaryCriticalMultiplier = "sevenfold"; var clone = template.SmartClone(); itemVerifier.AssertMagicalItemFromTemplate(clone, template); Assert.That(clone.ItemType, Is.EqualTo(template.ItemType)); Assert.That(clone.Attributes, Is.EquivalentTo(template.Attributes)); 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(template.DamageRoll)); Assert.That(cloneWeapon.DamageDescription, Is.Not.Empty.And.EqualTo(template.DamageDescription)); Assert.That(cloneWeapon.CriticalDamageRoll, Is.Not.Empty.And.EqualTo(template.CriticalDamageRoll)); Assert.That(cloneWeapon.CriticalDamageDescription, Is.Not.Empty.And.EqualTo(template.CriticalDamageDescription)); Assert.That(cloneWeapon.SecondaryDamageRoll, Is.Not.Empty.And.EqualTo(template.SecondaryDamageRoll)); Assert.That(cloneWeapon.SecondaryDamageDescription, Is.Not.Empty.And.EqualTo(template.SecondaryDamageDescription)); Assert.That(cloneWeapon.SecondaryCriticalDamageRoll, Is.Not.Empty.And.EqualTo(template.SecondaryCriticalDamageRoll)); Assert.That(cloneWeapon.SecondaryCriticalDamageDescription, Is.Not.Empty.And.EqualTo(template.SecondaryCriticalDamageDescription)); 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.Not.Zero.And.EqualTo(template.SecondaryMagicBonus)); Assert.That(cloneWeapon.SecondaryHasAbilities, Is.True.And.EqualTo(template.SecondaryHasAbilities)); }