Пример #1
0
        public async Task <ActionResult <CardResponse> > GetCard(long id)
        {
            var card = await _cardRepository.Get(id);

            var cardResponse = MapModelToResponse(card);

            return(cardResponse);
        }
Пример #2
0
        public void CanCreateCard()
        {
            var cardRepository = new CardRepository(Session);
            var card           = new Card("Testcard", "testType", "testexpansion", CardRarity.Common, "erwin bonnet", "whereever");

            cardRepository.Save(card);

            Session.Evict(card);
            Session.Clear();

            var cardFromRepository = cardRepository.Get(card.Id);

            Assert.AreEqual("Testcard", cardFromRepository.Name);
        }