public void TestClear() { var output = new OutputBuilder().Append(originalMessage); var outputBuilderType = output.GetType(); var bufferPos = outputBuilderType.GetField("bufferPos", BindingFlags.Instance | BindingFlags.NonPublic); Assert.AreEqual(originalMessage.Length, bufferPos.GetValue(output)); output.Clear(); Assert.AreEqual(0, bufferPos.GetValue(output)); }