예제 #1
0
        TestConfig GetTestBaseConfig()
        {
            var config = new NPSBDummyLib.TestConfig
            {
                DummyCount       = textBoxDummyCount.Text.ToInt32(),
                DummyStartNumber = textBoxDummyStartNumber.Text.ToInt32(),

                MaxRepeatCount   = textBox12.Text.ToUInt32(),
                MaxRepeatTimeSec = textBox2.Text.ToInt32(),
                LimitActionTime  = textBox9.Text.ToInt32(),

                EchoPacketSizeMin = textBox10.Text.ToInt32(),
                EchoPacketSizeMax = textBox11.Text.ToInt32(),

                RemoteIP      = textBoxIP.Text,
                RemotePort    = textBoxPort.Text.ToInt32(),
                PacketSizeMax = textBoxMaxPacketSize.Text.ToInt32(),
            };

            if (config.MaxRepeatTimeSec > 0)
            {
                config.MaxRepeatCount = 0;
            }

            if (checkBox1.Checked)
            {
                config.RemoteIP = "127.0.0.1";
            }

            return(config);
        }
예제 #2
0
        TestConfig GetTestBaseConfig()
        {
            var config = new NPSBDummyLib.TestConfig
            {
                ActionIntervalTime      = textBox3.Text.ToInt32(),
                ActionRepeatCount       = textBox12.Text.ToInt32(),
                DummyIntervalTime       = textBox14.Text.ToInt32(),
                LimitActionTime         = textBox9.Text.ToInt32(),
                RoomNumber              = textBox2.Text.ToInt32(),
                ChatMessage             = textBox6.Text,
                MaxVaildActionRecvCount = 3,
            };

            return(config);
        }
예제 #3
0
 public ActionDisconnect(DummyManager dummyManager, TestConfig config) :
     base(TestCase.ACTION_DISCONNECT, dummyManager, config)
 {
 }
예제 #4
0
 public ActionConnect(DummyManager dummyManange, TestConfig config) :
     base(TestCase.ACTION_CONNECT, dummyManange, config)
 {
 }
예제 #5
0
        public static async Task <(int, bool, string)> RepeatConnectAsync(Dummy dummy, TestConfig config, Func <bool> isContinue)
        {
            var expectConnectCount = config.RepeatConnectCount;
            var expectDateTime     = DateTime.Now.AddSeconds(config.RepeatConnectDateTimeSec);

            while (isContinue())
            {
                var result = await dummy.ConnectAsyncAndReTry(DummyManager.GetDummyInfo.RmoteIP, DummyManager.GetDummyInfo.RemotePort);

                if (result.Result == false)
                {
                    return(dummy.Index, false, result.Error);
                }


                dummy.Connected();
                dummy.DisConnect();

                if (expectConnectCount > 0 && expectConnectCount == dummy.ConnectCount)
                {
                    dummy.SetSuccess(true);
                    break;
                }
                else if (expectConnectCount == 0 && expectDateTime <= DateTime.Now)
                {
                    dummy.SetSuccess(true);
                    break;
                }
            }

            return(dummy.Index, true, "");
        }
 public ActionRoomEnter(DummyManager dummyMananger, TestConfig config) :
     base(TestCase.ACTION_ROOM_ENTER, dummyMananger, config)
 {
     RegistRecvFunc(PACKETID.RES_ROOM_ENTER, CheckResRoomEnter, true);
 }