public void CheckGuid() { MemoryStream buffer = new MemoryStream(); IFieldWriter writer = new FieldWriter(buffer); IFieldReader reader = new FieldReader(buffer); foreach (Guid expected in new Guid[] { Guid.Empty, Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() }) { buffer.Position = 0; writer.Write(expected); buffer.Position = 0; Guid actual = reader.ReadGuid(); Assert.AreEqual(expected, actual); } }