示例#1
0
        public void CardNew()
        {
            // Setup test params
            string url = "/api/card/new";

            // Add new card to client
            var ro = TestSetup.Type == TestSetup.TestType.LiteDB
                ? AsyncHelper.RunSync(() => _controller.CardNew(TestSetup.NewCard))
                : TestSetup.GetData <string>(url, JsonConvert.SerializeObject(TestSetup.NewCard));

            // Assert the result
            Assert.AreEqual(ro.ReturnCode, 0);

            // Check that the card is actually in the cardlist
            var card = GetCard(TestSetup.NewCard.RFID);

            Assert.IsNotNull(card);
            Assert.AreEqual(card.status, "A");
        }