Exemple #1
0
 protected static void SetBaseInfo <T>(T t)
     where T : BaseMo
 {
     if (t.id == 0)
     {
         t.id = NumUtil.SubTimeNum(MemberShiper.Identity.Id);
     }
     t.create_time = DateTime.Now.ToUtcSeconds();
 }
Exemple #2
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);
        }