Mercurial > hg > Database > jungle-sharp
diff src/test/csharp/jp.ac.u-ryukyu.ie.cr/jungle-network/operations/NetworkPutAttributeOperationTest.cs @ 13:4c8932dad7b2
Add Test and only NetworkTreeOperationLogTest.cs not work.
author | Kazuma |
---|---|
date | Sun, 23 Oct 2016 13:35:21 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/csharp/jp.ac.u-ryukyu.ie.cr/jungle-network/operations/NetworkPutAttributeOperationTest.cs Sun Oct 23 13:35:21 2016 +0900 @@ -0,0 +1,22 @@ +using UnityEngine; +using System.Collections; +using MsgPack; +using System; + +public class NetworkPutAttributeOperationTest : MonoBehaviour { + + // Use this for initialization + void Start () { + byte[] value = System.Text.ASCIIEncoding.UTF8.GetBytes("test"); + NetworkPutAttributeOperation op = new NetworkPutAttributeOperation("hoge", value); + + ObjectPacker pack = new ObjectPacker(); + // send this byte to server. + byte[] packValue = pack.Pack(op); + + ObjectPacker unpack = new ObjectPacker(); + NetworkPutAttributeOperation nOp = unpack.Unpack<NetworkPutAttributeOperation>(packValue); + print(System.Text.ASCIIEncoding.UTF8.GetString(nOp.getValue())); + print (nOp.getCommand()); + } +}