示例#1
0
        public void TestPut()
        {
            int         expected = 50;
            LimitNumber ln       = new LimitNumber(1, expected);
            var         result   = lnc.Put(1, ln);

            Assert.AreEqual(expected, result.LimitTal);
        }
示例#2
0
        public void TestGet()
        {
            int         expected = 200000000;
            LimitNumber ln       = new LimitNumber(1, expected);

            lnc.Put(1, ln);
            int actual = lnc.Get()[0].LimitTal;

            Assert.AreEqual(expected, actual);
        }
        public LimitNumber Put(int id, [FromBody] LimitNumber value)
        {
            LimitNumber i = Get(id);

            if (i != null)
            {
                var result = value.LimitTal;
                if (result > -1)
                {
                    i.LimitTal = result;
                }
            }
            return(Get(id));

            //hej
        }