public void Should_remove_banner_with_correct_id() { A.CallTo(() => _repository.Remove(A <int> .Ignored)) .Returns(true); var result = _controller.DeleteBanner(1) as StatusCodeResult; result.StatusCode.Should().Be(StatusCodes.Status200OK); }
public void Calls_IBannerRepository() { //arrange string id = ""; //act var response = _bannerController.DeleteBanner(id); //assert _bannerRepository.Verify(br => br.DeleteBanner(id), Times.Once); }
/// ----------------------------------------------------------------------------- /// <summary> /// cmdDelete_Click runs when the Delete Button is clicked /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 9/21/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> /// ----------------------------------------------------------------------------- protected void OnDeleteClick(object sender, EventArgs e) { try { if (BannerId != -1) { var objBanner = new BannerController(); objBanner.DeleteBanner(BannerId); //Redirect back to the portal home page Response.Redirect(EditUrl("VendorId", VendorId.ToString()), true); } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }