public void TestRoundtrip() { var inBytes = File.ReadAllBytes("FR112.nbt"); var commands = TraceReader.Read(inBytes); var outBytes = TraceSerializer.Serialize(commands); Assert.AreEqual(inBytes.Length, outBytes.Length); for (var i = 0; i < inBytes.Length; i++) { Assert.AreEqual(inBytes[i], outBytes[i], string.Format("byte #{0}", i)); } }
private byte[] S(ICommand cmd) { return(TraceSerializer.Serialize(new[] { cmd })); }