annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
1 using UnityEngine;
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
2 using System.Collections;
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
3 using MsgPack;
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
4 using System;
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
5
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
6 public class NetworkPutAttributeOperationTest : MonoBehaviour {
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
7
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
8 // Use this for initialization
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
9 void Start () {
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
10 byte[] value = System.Text.ASCIIEncoding.UTF8.GetBytes("test");
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
11 NetworkPutAttributeOperation op = new NetworkPutAttributeOperation("hoge", value);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
12
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
13 ObjectPacker pack = new ObjectPacker();
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
14 // send this byte to server.
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
15 byte[] packValue = pack.Pack(op);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
16
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
17 ObjectPacker unpack = new ObjectPacker();
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
18 NetworkPutAttributeOperation nOp = unpack.Unpack<NetworkPutAttributeOperation>(packValue);
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
19 print(System.Text.ASCIIEncoding.UTF8.GetString(nOp.getValue()));
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
20 print (nOp.getCommand());
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
21 }
4c8932dad7b2 Add Test and only NetworkTreeOperationLogTest.cs not work.
Kazuma
parents:
diff changeset
22 }