コード例 #1
0
ファイル: TlvEncodingTest.cs プロジェクト: kobah2005/TlvLib
        public void WriteTagInvalid(uint tag)
        {
            var ms = new MemoryStream();

            Assert.ThrowsException <TlvException>(() => {
                TlvEncoding.WriteTag(ms, tag);
            });
        }
コード例 #2
0
ファイル: TlvEncodingTest.cs プロジェクト: kobah2005/TlvLib
        public void WriteTagSuccess(uint tag, byte[] expectedOutput)
        {
            var ms = new MemoryStream();

            TlvEncoding.WriteTag(ms, tag);

            ms.Position = 0;
            var buf = new byte[ms.Length];

            ms.Read(buf, 0, buf.Length);
            AssertByteArrayEqual(expectedOutput, buf);
        }