public virtual void TestCopyTo() { CharTermAttribute t = new CharTermAttribute(); CharTermAttribute copy = TestToken.AssertCopyIsEqual(t); Assert.AreEqual("", t.ToString()); Assert.AreEqual("", copy.ToString()); t = new CharTermAttribute(); char[] content = "hello".ToCharArray(); t.CopyBuffer(content, 0, 5); char[] buf = t.Buffer; copy = TestToken.AssertCopyIsEqual(t); Assert.AreEqual(t.ToString(), copy.ToString()); Assert.AreNotSame(buf, copy.Buffer); }