Exemple #1
0
    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");
    }
Exemple #2
0
 /// <inheritdoc />
 public void DeleteUnit(DeleteUnitDto deleteArticleGroupDto)
 {
     SimpleCrudHelper.Delete <Unit>(deleteArticleGroupDto.UnitId);
 }