UniVRM/UniJSON/Editor/Tests/MsgPack/RawTest.cs
ousttrue df85433628 Merge commit 'df5f79584312cf4f6cc7ec1d73a78f6ba475c9ad' as 'UniJSON'
Co-authored-by: Deatrathias <dmailsec@gmail.com>
Co-authored-by: dj-kusuha <dj.kusuha+github@gmail.com>
Co-authored-by: ousttrue <ousttrue@gmail.com>
Co-authored-by: yutopp <yutopp@gmail.com>
2018-12-28 20:38:39 +09:00

35 lines
912 B
C#

using NUnit.Framework;
using System;
using System.Linq;
namespace UniJSON.MsgPack
{
[TestFixture]
public class RawTest
{
[Test]
public void fix_raw()
{
var src = new Byte[] { 0, 1, 2 };
var f = new MsgPackFormatter();
f.Value(src);
var bytes = f.GetStoreBytes();
var v = MsgPackParser.Parse(bytes).Value.GetBody();
Assert.True(src.SequenceEqual(v.ToEnumerable()));
}
[Test]
public void raw16()
{
var src = Enumerable.Range(0, 50).Select(x => (Byte)x).ToArray();
var f = new MsgPackFormatter();
f.Value(src);
var bytes = f.GetStoreBytes();
var v = MsgPackParser.Parse(bytes).Value.GetBody();
Assert.True(src.SequenceEqual(v.ToEnumerable()));
}
}
}