Пример #1
0
        public void Test_Bid(int bid)
        {
            var seat = new DSeat();

            seat.Initialize();
            seat.ChipTotal = 25;

            seat.Bid(bid);
            seat.Bid(bid);

            Assert.True(seat.ChipTotal >= 0);
            Assert.False(seat.ChipTotal == 25);
        }
Пример #2
0
        public async Task <string> Bid(string jsonSeat, string bid)
        {
            DSeat seat = JsonConvert.DeserializeObject <DSeat>(jsonSeat);
            int   actualBid;

            if (!Int32.TryParse(bid, out actualBid))
            {
                return(null);
            }

            seat.Bid(actualBid);

            string returnVal = JsonConvert.SerializeObject(seat);

            return(await Task.Run(() => { return returnVal; }));
        }