Beispiel #1
0
        public void Test1()
        {
            var id   = NumUtil.SnowNum().ToString();
            var time = DateTime.Now.ToUtcSeconds();

            var addRes = UserInfoRep.Instance.Add(new UserInfo()
            {
                id        = id,
                user_name = $"test_name_{id}",
                add_time  = time,
                m_time    = time
            }).Result;

            Assert.True(addRes.IsSuccess());

            var updateRes = UserInfoRep.Instance.UpdateName(id, $"test_update_name{id}").Result;

            Assert.True(updateRes.IsSuccess());


            var getRes = UserInfoRep.Instance.Get(id).Result;

            Assert.True(getRes.IsSuccess());

            var getListRes = UserInfoRep.Instance.GetList().Result;

            Assert.True(getListRes.IsSuccess());
        }
Beispiel #2
0
 public long Add(ActionInfo model)
 {
     model.Id = NumUtil.SnowNum();
     if (_ActionInfoRepository.Add(model) > 0)
     {
         return(model.Id);
     }
     return(0);
 }
Beispiel #3
0
        public void TestMethod1()
        {
            var snowStr1 = NumUtil.SnowNum();
            var snowStr2 = NumUtil.SnowNum();

            Assert.IsTrue(snowStr2 != snowStr1);

            var timeNum1 = NumUtil.TimeMilliNum();
            var timeNum2 = NumUtil.TimeMilliNum() + 1;

            Assert.IsTrue(timeNum1 != timeNum2);

            var subTimeNum = NumUtil.SubTimeNum(timeNum1);

            Assert.IsTrue(timeNum1 % 10000 == subTimeNum % 10000);
        }