public void Delete() { var test = Insert(); _testRepository.Delete(test); _unitOfWork.SaveChanges(); var newTest = _testRepository.GetAll().FirstOrDefault(x => x.Id == test.Id); Assert.True(newTest == null); }
public bool DeleteTest(DeleteTestModel model) { _testRepository.Delete(new TestThu { Id = model.Id }); return(true); }
public async Task <MessageResponse> DeleteTestAsync(int testId) { await _testRepository.Delete(testId); await _unitOfWork.CompleteAsync(); return(new MessageResponse(true, "Test deleted successfully")); }
/// <summary> /// Remove existing Test. /// </summary> /// <param name="test"> Test to remove.</param> public void DeleteTest(BllTest test) { if (test == null) { throw new ArgumentNullException(nameof(test)); } repository.Delete(test.ToDalTest()); service.Save(); }
public void DeleteTest(TestEntity test) { if (test == null) { throw new ArgumentNullException(); } repo.Delete(test.Id); uow.Save(); }
public HttpResponseMessage Delete(int id) { try { _dbRepository.Delete(id); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } }
public IActionResult DeleteTest(long id) { Test test = test_repo.Find(id); if (test == null) { return(NotFound()); } test_repo.Delete(test); return(Ok()); }
public async Task <DeletedTestDto> DeleteTest(int testId) { Test test = await testRepository.GetByIdAsync(testId); if (test == null) { return(null); } testRepository.Delete(test); await unitOfWork.SaveAsync(); return(mapper.Map <DeletedTestDto>(test)); }
public void Can_Delete_Entity() { // Arrange var entity = new TestEntity("A", "B", "C", true); _connection.AddResultForDataReader(cmd => cmd.CommandText == "DELETE...", new[] { new TestEntity("A1", "B1", "C1", true) }); //suffixes get ignored because Delete does not read result // Act var actual = _repository.Delete(entity); // Assert actual.Code.Should().Be(entity.Code); actual.CodeType.Should().Be(entity.CodeType); actual.Description.Should().Be(entity.Description); actual.IsExistingEntity.Should().BeTrue(); }
public bool Delete(Guid id) { return(_testRepository.Delete(id)); }
public async Task <bool> Delete(Guid id) { return(await _testRepository.Delete(id)); }
public void DeleteTest(TestEntity e) { testRepository.Delete(e.ToDalTest()); uow.Commit(); }
public IActionResult Delete(int id) { _testRepository.Delete(id); return(Ok()); }
public int Delete(int id) { return(repository.Delete(id)); }
/// <summary> /// Removes a test /// </summary> /// <param name="entity">Test</param> public void Delete(BllTest entity) { testRepository.Delete(entity.ToDalTest()); DeleteTestQuestions(entity.Id); unitOfWork.Commit(); }
public IActionResult DeleteConfirmed(int id) { _testRepository.Delete(id); return(RedirectToAction("Index", "Home")); }
public async Task Delete(int testId) { await _testRepository.Delete(testId); }