/// <summary> /// Clones this MolecularFormulaSet object and its content. /// </summary> /// <returns>The cloned object</returns> public virtual object Clone() { MolecularFormulaSet clone = new MolecularFormulaSet(); foreach (var mf in this) { clone.Add((IMolecularFormula)mf.Clone()); } return(clone); }
/// <summary> /// Clones this MolecularFormulaSet object and its content. /// </summary> /// <returns>The cloned object</returns> public virtual object Clone() { // /* it is not a super class of chemObject */ // MolecularFormulaSet clone = (MolecularFormulaSet) base.Clone(); // // start from scratch // clone.Clear(); // // clone all molecularFormulas // IEnumerator<IMolecularFormula> iterForm = this; // while(iterForm.MoveNext()){ // clone.AddMolecularFormula((IMolecularFormula) iterForm.Next().Clone()); // } MolecularFormulaSet clone = new MolecularFormulaSet(); foreach (var mf in this) { clone.Add((IMolecularFormula)mf.Clone()); } return(clone); }
public void TestMolecularFormulaSet_IMolecularFormula() { IMolecularFormulaSet mfS = new MolecularFormulaSet(Builder.NewMolecularFormula()); Assert.AreEqual(1, mfS.Count); }
public void TestMolecularFormulaSet() { IMolecularFormulaSet mfS = new MolecularFormulaSet(); Assert.IsNotNull(mfS); }