Esempio n. 1
0
        public void TestThread()
        {
            InitTest(new LuaPersonParamBLL(new MSSqlDBContext()));

            List <Task> ts       = new List <Task>();
            int         forcount = 100;

            for (int i = 0; i < forcount; i++)
            {
                ts.Add(Task.Run(() =>
                {
                    var p = new LuaPersonParamBLL(new MSSqlDBContext());
                    Assert.True(p.Get1(name, null)?.Count > 0);
                    Assert.True(p.Get1(name, addrid)?.Count > 0);
                    Assert.True(p.Get11(name, null)?.Count > 0);
                    Assert.True(p.Get11(name, addrid)?.Count > 0);

                    Assert.True(p.Get12(null, addrid)?.Count > 0);
                    Assert.True(p.Get12("", addrid)?.Count > 0);
                    Assert.True(p.Get12(name, addrid)?.Count > 0);

                    Assert.True(p.Get13(null, addrid)?.Count > 0);
                    Assert.True(p.Get13("", addrid)?.Count > 0);
                    Assert.True(p.Get13(name, addrid)?.Count > 0);
                }));
                ts.Add(Task.Run(() =>
                {
                    var p = new LuaPersonParamBLL(new MSSqlDBContext());
                    Assert.True(p.Get2(name, null, null)?.Count > 0);
                    Assert.True(p.Get2(name, addrid, DateTime.Now)?.Count > 0);
                }));
                ts.Add(Task.Run(() =>
                {
                    var p = new LuaPersonParamBLL(new MSSqlDBContext());
                    Assert.True(p.Get31(name, null)?.Count > 0);
                    Assert.True(p.Get31(name, addrid)?.Count > 0);

                    Assert.True(p.Get32(name, null)?.Count > 0);
                    Assert.True(p.Get32(name, addrid)?.Count > 0);

                    Assert.True(p.Get33(null)?.Count > 0);
                    Assert.True(p.Get33("")?.Count > 0);
                    Assert.True(p.Get33(name)?.Count > 0);
                }));
            }
            Task.WaitAll(ts.ToArray());

            DelTest();
        }
Esempio n. 2
0
        public void Test()
        {
            InitTest();

            Assert.True(p.Get1(name, null)?.Count > 0);
            Assert.True(p.Get1(name, addrid)?.Count > 0);
            Assert.True(p.Get11(name, null)?.Count > 0);
            Assert.True(p.Get11(name, addrid)?.Count > 0);

            Assert.True(p.Get12(null, addrid)?.Count > 0);
            Assert.True(p.Get12("", addrid)?.Count > 0);
            Assert.True(p.Get12(name, addrid)?.Count > 0);

            Assert.True(p.Get13(null, addrid)?.Count > 0);
            Assert.True(p.Get13("", addrid)?.Count > 0);
            Assert.True(p.Get13(name, addrid)?.Count > 0);

            DelTest();
        }