public void Card_06Test_RemoveNotFound() { // Act var badResponse = _controller.Delete(idCardNotFound); // Assert Assert.IsInstanceOf <OkObjectResult>(badResponse); }
//удалить карточку private void DeleteCard() { var result = CardController.Delete(GridCards[SelectedIndexCard].CardId); if (result) { MessageBox.Show("Карточка удалена!"); } else { MessageBox.Show("Карточка не удалена, так как к ней привязаны данные записей на услуги!"); } }
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>()); }
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); }
public void Delete() => CardController.Delete(Thootle);