Exemplo n.º 1
0
        public void CardReplace()
        {
            // Setup test params
            string url = "/api/card/replace";

            // Replace card for client
            var ro = TestSetup.Type == TestSetup.TestType.LiteDB
                ? AsyncHelper.RunSync(() => _controller.CardReplace(TestSetup.ReplacementCard))
                : TestSetup.GetData <string>(url, JsonConvert.SerializeObject(TestSetup.ReplacementCard));

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

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

            Assert.IsNotNull(card);
            Assert.AreEqual(card.status, "D");

            var replacementCard = GetCard(TestSetup.ReplacementCard.ReplacementRFID);

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