Esempio n. 1
0
        public void DeleteAsync_CardIdentifier_CardDeleted()
        {
            // Arrange
            var cardIdentifier = 1;
            var card           = new Card
            {
                Id           = cardIdentifier,
                UserId       = "QWERTY123",
                UniqueNumber = "123-45",
                Status       = CardStatusType.Active,
                Level        = LevelType.Admin,
            };

            _applicationContext.Cards.Add(card);
            _applicationContext.SaveChanges();

            // Act
            _cardManager.DeleteAsync(cardIdentifier)
            .GetAwaiter()
            .GetResult();

            _applicationContext.SaveChanges();

            // Assert
            Assert.Equal(0, _applicationContext.Cards.Count());
        }