コード例 #1
0
        public void Card_06Test_RemoveNotFound()
        {
            // Act
            var badResponse = _controller.Delete(idCardNotFound);

            // Assert
            Assert.IsInstanceOf <OkObjectResult>(badResponse);
        }
コード例 #2
0
ファイル: MainViewModel.cs プロジェクト: alinadk12/vetclinic
        //удалить карточку
        private void DeleteCard()
        {
            var result = CardController.Delete(GridCards[SelectedIndexCard].CardId);

            if (result)
            {
                MessageBox.Show("Карточка удалена!");
            }
            else
            {
                MessageBox.Show("Карточка не удалена, так как к ней привязаны данные записей на услуги!");
            }
        }
コード例 #3
0
        public async Task DeleteShouldReturnViewResult()
        {
            // Arrange
            int id         = 1;
            var mockCard   = new Mock <ICardWebService>();
            var mockWallet = new Mock <IWalletWebService>();

            var controller = new CardController(mockCard.Object, mockWallet.Object);

            // Act
            var result = await controller.Delete(id);

            // Assert
            Assert.That(result, Is.TypeOf <ViewResult>());
        }
コード例 #4
0
        public async Task Delete_NotNull_ResultIsNotNull()
        {
            //Arrange
            var card       = new WalletViewModel();
            var mockCard   = new Mock <ICardWebService>();
            var mockWallet = new Mock <IWalletWebService>();

            mockCard.Setup(g => g.Delete(card.Id));
            var controller = new CardController(mockCard.Object, mockWallet.Object);

            //Act
            ViewResult result = await controller.Delete(card.Id) as ViewResult;

            //Assert
            Assert.IsNotNull(result);
        }
コード例 #5
0
 public void Delete() => CardController.Delete(Thootle);