Exemple #1
0
        public async Task Create_Batch_Shortcut()
        {
            var json = File.ReadAllText(@"C:\Users\liume\Desktop\Work\DalTestDB\ProfileData.json");
            var list = JsonConvert.DeserializeObject <List <UserInfo> >(json);

            foreach (var item in list)
            {
                item.Id = Guid.NewGuid();
                //Thread.Sleep(1);
                item.CreatedOn = DateTime.Now;
            }

            xx = string.Empty;

            Assert.True(!list.Any(it => it.RootUser));
            Assert.True(!list.Any(it => it.InvitedCount > 0));
            Assert.True(!list.Any(it => !string.IsNullOrWhiteSpace(it.ArrangePathId)));
            Assert.True(!list.Any(it => it.IsVIP));
            Assert.True(!list.Any(it => it.IsActived));

            var res4 = await Conn.CreateBatchAsync(list);

            Assert.True(res4 == list.Count);

            xx = string.Empty;
        }
Exemple #2
0
        public async Task test()
        {
            /****************************************************************************************/

            var xx15 = "";

            var pk  = Guid.Parse("8f2cbb64-8356-4482-88ee-016558c05b2d");
            var m15 = new AlipayPaymentRecord
            {
                Id              = pk,
                CreatedOn       = DateTime.Parse("2018-08-20 19:12:05.933786"),
                PaymentRecordId = Guid.Parse("e94f747e-1a6d-4be6-af51-016558c05b29"),
                OrderId         = Guid.Parse("f60f08e7-9678-41a8-b4aa-016558c05afc"),
                TotalAmount     = 0.010000000000000000000000000000M,
                Description     = null,
                PaymentSN       = "2018082021001004180510465833",
                PayedOn         = DateTime.Parse("2018-08-20 20:36:35.720525"),
                CanceledOn      = null,
                PaymentUrl      = "https://openapi.xxx?charset=UTF-8&app_id=xxx&biz_content=xxx&charset=UTF-8&format=JSON&method=zzz&return_url=xxx&sign_type=yyy&timestamp=zzz&version=1.0"
            };
            await Conn.DeleteAsync <AlipayPaymentRecord>(pk);

            var res15 = await Conn.CreateAsync <AlipayPaymentRecord>(m15);

            Assert.True(res15 == 1);

            var tuple15 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            var res151 = await Conn.GetAsync <AlipayPaymentRecord>(pk);

            Assert.NotNull(res151);

            /****************************************************************************************/

            var xx16 = "";

            var json   = File.ReadAllText(@"C:\Users\liume\Desktop\Work\DalTestDB\ProfileData.json");
            var list16 = JsonConvert.DeserializeObject <List <UserInfo> >(json);

            foreach (var item in list16)
            {
                item.Id        = Guid.NewGuid();
                item.CreatedOn = DateTime.Now;
            }
            var res16 = await Conn.CreateBatchAsync <UserInfo>(list16);

            Assert.True(list16.Count == res16);

            var tuple16 = (XDebug.SQL, XDebug.Parameters, XDebug.SqlWithParams);

            /****************************************************************************************/
        }
Exemple #3
0
        public async Task History_02()
        {
            var list1 = await new CreateData().PreCreateBatchV2(Conn);

            xx = string.Empty;

            var res1 = await Conn.CreateBatchAsync(list1);

            Assert.True(res1 == 10);



            /********************************************************************************************************************************/

            xx = string.Empty;
        }