public virtual void TestToString() { IChemSequence cs = (IChemSequence)NewChemObject(); string description = cs.ToString(); for (int i = 0; i < description.Length; i++) { Assert.IsTrue(description[i] != '\n'); Assert.IsTrue(description[i] != '\r'); } }
/// <summary> Returns a String representation of this class. It implements /// RFC #9. /// /// </summary> /// <returns> String representation of the Object /// </returns> public override System.String ToString() { System.Text.StringBuilder buffer = new System.Text.StringBuilder(); buffer.Append("ChemFile(#S="); IChemSequence[] seqs = ChemSequences; buffer.Append(seqs.Length); buffer.Append(", "); for (int i = 0; i < seqs.Length; i++) { IChemSequence sequence = seqs[i]; //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Object.toString' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'" buffer.Append(sequence.ToString()); } buffer.Append(')'); return(buffer.ToString()); }