public void InitializeRopeFromLongString() { string text = BuildLongString(1000); Rope <char> rope = new Rope <char>(text); Assert.AreEqual(text.Length, rope.Length); Assert.AreEqual(text, rope.ToString()); Assert.AreEqual(text.ToCharArray(), rope.ToArray()); }
public void TestToArrayAndToStringWithParts() { string text = BuildLongString(1000); Rope <char> rope = new Rope <char>(text); string textPart = text.Substring(1200, 600); char[] arrayPart = textPart.ToCharArray(); Assert.AreEqual(textPart, rope.ToString(1200, 600)); Assert.AreEqual(arrayPart, rope.ToArray(1200, 600)); Rope <char> partialRope = rope.GetRange(1200, 600); Assert.AreEqual(textPart, partialRope.ToString()); Assert.AreEqual(arrayPart, partialRope.ToArray()); }