Scalien.Users.InsertUsers C# (CSharp) Method

InsertUsers() public method

public InsertUsers ( int cnt ) : void
cnt int
return void
        public void InsertUsers(int cnt)
        {
            while (cnt-- > 0) AddUser();
            clients[client_index].Submit();
        }

Usage Example

Exemplo n.º 1
0
        //[TestMethod]
        public void ShortTest_1000_Threads()
        {
            int init_users = 1000;
            int threadnum = 1000;

            Users usr = new Users(Utils.GetConfigNodes());
            usr.EmptyAll();
            usr.InsertUsers(init_users);

            Utils.TestThreadConf threadConf = new Utils.TestThreadConf();
            threadConf.param = 500;

            Thread[] threads = new Thread[threadnum];
            for (int i = 0; i < threadnum; i++)
            {
                threads[i] = new Thread(new ParameterizedThreadStart(TestWorker));
                threads[i].Start(threadConf);
            }

            for (int i = 0; i < threadnum; i++)
            {
                threads[i].Join();
            }

            if (threadConf.exceptionsCatched.Count > 0)
                Assert.Fail("Exceptions catched in threads", threadConf);

            Console.WriteLine("Checking consistency");

            Assert.IsTrue(usr.IsConsistent());
        }
All Usage Examples Of Scalien.Users::InsertUsers