コード例 #1
0
ファイル: DeferredActionTest.cs プロジェクト: EBassie/Potato
        public void TestDeferredActionSent()
        {
            bool sentFlag = false;
            INetworkAction chat = new NetworkAction();

            DeferredAction<INetworkAction> deferredAction = new DeferredAction<INetworkAction>() {
                Action = chat,
                Sent = (action, requests) => {
                    sentFlag = true;
                }
            };

            Assert.IsTrue(deferredAction.TryInsertSent(chat, new List<IPacket>() {
                new Packet() {
                    Origin = PacketOrigin.Client,
                    Type = PacketType.Request,
                    RequestId = 1
                }
            }));
            Assert.IsTrue(sentFlag);
        }