public void DeleteUnit() { using var context = new InMemoryDbContext(); var existingUnit = context.Units.Add(new Unit("Piece")); context.SaveChanges(); var testee = new UnitService(new SimpleCrudHelper(context, TestMapper.Create())); var deleteUnitDto = new DeleteUnitDto(existingUnit.Entity.UnitId); testee.DeleteUnit(deleteUnitDto); context.Units.Should().NotContain(x => x.Name == "Piece"); }
/// <inheritdoc /> public void DeleteUnit(DeleteUnitDto deleteArticleGroupDto) { SimpleCrudHelper.Delete <Unit>(deleteArticleGroupDto.UnitId); }