@@ -0,0 +1,2455 @@
+package com.lightcrafts.image.metadata.makernotes;%0A%0Aimport com.lightcrafts.image.BadImageFileException;%0Aimport com.lightcrafts.image.ImageInfo;%0Aimport com.lightcrafts.image.UnknownImageTypeException;%0Aimport com.lightcrafts.image.metadata.ImageMetadata;%0Aimport com.lightcrafts.image.metadata.values.UndefinedMetaValue;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.text.SimpleDateFormat;%0A%0Aimport static com.lightcrafts.image.metadata.makernotes.PentaxTags.PENTAX_DATE;%0Aimport static com.lightcrafts.image.metadata.makernotes.PentaxTags.PENTAX_TIME;%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aclass PentaxDirectoryTest %7B%0A%0A    private PentaxDirectory dir;%0A%0A    @BeforeEach%0A    void setUp() throws UnknownImageTypeException, IOException, BadImageFileException %7B%0A        final var filename = %22raw%22 + File.separator + %22sample1.pef%22;%0A        final var url = getClass().getClassLoader().getResource(filename);%0A        if (url == null) %7B%0A            throw new IOException(%22file not found!%22);%0A        %7D%0A        final var file = new File(url.getPath());%0A        final var imageInfo = ImageInfo.getInstanceFor(file);%0A        final ImageMetadata metadata = imageInfo.getMetadata();%0A        dir = (PentaxDirectory) metadata.getDirectoryFor(PentaxDirectory.class, true);%0A    %7D%0A%0A    @Test%0A    void putValue() %7B%0A        // Given%0A        final var pattern = %22yyyy-MM-dd HH:mm:ss%22;%0A        final var formatter = new SimpleDateFormat(pattern);%0A%0A        // When put a PENTAX_DATE value%0A        final byte%5B%5D yymd = %7B 0x07, (byte) 0xE5, 9, 21 %7D;%0A        final var date = new UndefinedMetaValue(yymd);%0A        dir.putValue(PENTAX_DATE, date);%0A%0A        // Then captureDateTime should be set%0A        final var dateTime = dir.getCaptureDateTime();%0A        final var dateStr = %222021-09-21 00:00:00%22;%0A        assertThat(formatter.format(dateTime))%0A                .isEqualTo(dateStr);%0A%0A        // When put PENTAX_TIME%0A        final byte%5B%5D hms = %7B 6, 12, 34 %7D;%0A        final var time = new UndefinedMetaValue(hms);%0A        dir.putValue(PENTAX_TIME, time);%0A%0A        // Then captureDateTime should increase%0A        final var modifiedDateTime = dir.getCaptureDateTime();%0A        final var modifiedDateStr = %222021-09-21 06:12:34%22;%0A        assertThat(formatter.format(modifiedDateTime))%0A                .isEqualTo(modifiedDateStr);%0A%0A        // TODO: Add tests for other tags%0A    %7D%0A%7D

Add PentaxDirectoryTest