public async Task <ActionResult> Delete(string id)
        {
            if (id is null)
            {
                return(BadRequest());
            }
            await _buildService.DeleteBuild(id);

            return(Ok());
        }
Пример #2
0
        public IActionResult OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            _context.DeleteBuild(id.Value);

            return(RedirectToPage("./Index"));
        }
Пример #3
0
        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));
        }