示例#1
0
        public Client(int id, Config cfg, SynchronizationContext ctx)
        {
            ClientStatisticsGatherer = new ClientStatisticsGatherer();

              _ctx = ctx;
              _id = id;

              Data = new TestData(this);
              IsStopped = false;

              _log = LogManager.GetLogger("Client_" + _id);
              _log.Debug("Client created");

              Configure(cfg);

              if (String.IsNullOrEmpty(_login))
              {
            const string err = "Login command is not specified!!! Can't do any test.";
            _log.Error(err);

            throw new Exception(err);
              }

              _ajaxHelper = new AjaxHelper(new AjaxConn(_login, cfg.ServerIp, cfg.AjaxPort, _ctx));
              _webSock = new WebSockConn(_login, cfg.ServerIp, cfg.WsPort, ctx);

              _webSock.CcsStateChanged += WsOnCcsStateChanged;
              _webSock.InitializationFinished += () => _testMng.GetTest<LoginTest>().OnClientInitialized();
              _testMng.SetEnv(_login, _ajaxHelper.AjaxConn, _webSock);
        }
示例#2
0
        public CardListTest(int numberOfPageChanging, ClientStatisticsGatherer statisticsGatherer)
        {
            for (int i = 0; i < numberOfPageChanging; ++i)
              {
            AddTest(new ChangePage(10, 1){ StatisticsGatherer = statisticsGatherer });
            AddTest(new ChangePage(10, 0){ StatisticsGatherer = statisticsGatherer });
              }

              var data = TestStaticDataMng.Get(_login);

              if (data == null)
            return;

              data.CardListTest = this;
        }
示例#3
0
 public CardTest(ClientStatisticsGatherer statisticsGatherer)
 {
     StatisticsGatherer = statisticsGatherer;
       AddTest(new OpenCard(this){StatisticsGatherer = StatisticsGatherer});
 }