public void DeleteLabel_InValidId() { _labelService.Setup(p => p.DeleteLabel(0)).Returns(0); var returnObj = labelController.DeleteLabel(0); var okResult = returnObj.Result as ObjectResult; Assert.IsTrue((int)okResult.Value == 0); }
public void Delete_ExistingIdPassed_RemovesItem() { // Act _ = controller.DeleteLabel("1").Result; // Assert var result = controller.GetLabels().Result; var items = Assert.IsType <List <Label> >(result.Value); Assert.Single(items); }
public async Task DeleteLabelTest() { IActionResult result = await controller.DeleteLabel(1); OkObjectResult response = result as OkObjectResult; Assert.AreEqual(StatusCodes.Status200OK, (int)response.StatusCode); }