public async Task <ActionResult> Delete(string id) { if (id is null) { return(BadRequest()); } await _buildService.DeleteBuild(id); return(Ok()); }
public IActionResult OnPostAsync(int?id) { if (id == null) { return(NotFound()); } _context.DeleteBuild(id.Value); return(RedirectToPage("./Index")); }
public void DeleteBuild_DeleteBuild_RepositoryMehtodWasCalled() { //Arrange BuildEntity entity = new BuildEntity(); BuildRepository.Setup(x => x.FindById(It.IsAny <Guid>())).Returns(entity); //Act buildService.DeleteBuild(new Guid()); //Assert BuildRepository.Verify(x => x.Delete(entity)); }