public void WriteData_Test() { IFileObject[] all = new IFileObject[] { new PDFNumber(1), new PDFNumber(2), new PDFNumber(3) }; PDFArray target = new PDFArray(all); string actual; using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) { using (PDFWriter writer = new PDFWriter14(stream, new Scryber.Logging.DoNothingTraceLog(TraceRecordLevel.Diagnostic))) { target.WriteData(writer); writer.InnerStream.Flush(); } stream.Position = 0; using (System.IO.StreamReader sr = new System.IO.StreamReader(stream)) { actual = sr.ReadToEnd(); } } PDFArray parsed = PDFArray.Parse(actual.Trim()); Assert.AreEqual(parsed.Count, target.Count); Assert.AreEqual(parsed[0], target[0]); Assert.AreEqual(parsed[1], target[1]); Assert.AreEqual(parsed[2], target[2]); }