<commit_before>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Xunit;
using NExifTool;


namespace NExifTool.Tests
{
    public class ParseTests
    {
        [Fact]
        public async void HasExtensionTags()
        {
            var et = new ExifTool(new ExifToolOptions());
            var tags = await et.GetTagsAsync("35781602-96011d02-09ec-11e8-9335-aaa98042aa5a.jpg");

            var res = tags
                .Where(x => x.Id.StartsWith("apple"))
                .ToList();

            foreach(var tag in res)
            {
                Console.WriteLine($"{tag.Id} : {tag.Name} : {tag.Description} : {tag.Value}");
            }

            Assert.True(res.Count() > 0, "HasExtensionTags::1");
            Assert.True(res.Count(x => x.Id == "apple-fi:RegionsRegionListExtensionsAngleInfoYaw" ) >= 1, "HasExtensionTags::2");
            Assert.True(res.Count(x => x.Name == "RegionExtensionsAngleInfoYaw" ) >= 1, "HasExtensionTags::3");
        }


        [Fact]
        public async void GetTagsFromImage()
        {
            var et = new ExifTool(new ExifToolOptions());

            var res = (await et.GetTagsAsync("DSC_3982.NEF")).ToList();

            foreach(var tag in res)
            {
                Console.WriteLine($"{tag.Name} : {tag.Description} : {tag.Value}");
            }

            Assert.True(res.Count() > 0);
        }


        [Fact]
        public async void GetTagsFromImageWithKeywords()
        {
            var et = new ExifTool(new ExifToolOptions());

            var res = (await et.GetTagsAsync("50032922-56e5cc00-ffee-11e8-9cc9-a1330b3a909f.jpg")).ToList();

            foreach(var tag in res)
            {
                Console.WriteLine($"{tag.Name} : {tag.Description} : {tag.Value}");
            }

            Assert.True(res.Count() > 0);
        }


        [Fact]
        public async void TestFilenameWithSpace()
        {
            var et = new ExifTool(new ExifToolOptions());
            var res = (await et.GetTagsAsync("space test.NEF")).ToList();

            Assert.True(res.Count() > 0);
        }


        [Fact]
        public async void TestExifValues()
        {
            var et = new ExifTool(new ExifToolOptions());
            var tags = (await et.GetTagsAsync("DSC_3982.NEF")).ToList();<commit_msg>add more specific keyword parsing test<commit_after>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Xunit;
using NExifTool;


namespace NExifTool.Tests
{
    public class ParseTests
    {
        [Fact]
        public async void HasExtensionTags()
        {
            var et = new ExifTool(new ExifToolOptions());
            var tags = await et.GetTagsAsync("35781602-96011d02-09ec-11e8-9335-aaa98042aa5a.jpg");

            var res = tags
                .Where(x => x.Id.StartsWith("apple"))
                .ToList();

            foreach(var tag in res)
            {
                Console.WriteLine($"{tag.Id} : {tag.Name} : {tag.Description} : {tag.Value}");
            }

            Assert.True(res.Count() > 0, "HasExtensionTags::1");
            Assert.True(res.Count(x => x.Id == "apple-fi:RegionsRegionListExtensionsAngleInfoYaw" ) >= 1, "HasExtensionTags::2");
            Assert.True(res.Count(x => x.Name == "RegionExtensionsAngleInfoYaw" ) >= 1, "HasExtensionTags::3");
        }


        [Fact]
        public async void GetTagsFromImage()
        {
            var et = new ExifTool(new ExifToolOptions());

            var res = (await et.GetTagsAsync("DSC_3982.NEF")).ToList();

            foreach(var tag in res)
            {
                Console.WriteLine($"{tag.Name} : {tag.Description} : {tag.Value}");
            }

            Assert.True(res.Count() > 0);
        }


        [Fact]
        public async void GetTagsFromImageWithKeywords()
        {
            var et = new ExifTool(new ExifToolOptions());

            var res = (await et.GetTagsAsync("50032922-56e5cc00-ffee-11e8-9cc9-a1330b3a909f.jpg")).ToList();

            foreach(var tag in res)
            {
                Console.WriteLine($"{tag.Name} : {tag.Description} : {tag.Value}");
            }

            Assert.True(res.Count() > 0);

            var keywords = res.SingleOrDefaultPrimaryTag("keywords");

            Assert.NotNull(keywords);
            Assert.NotNull(keywords.List);
            Assert.Equal(3, keywords.List.Count);
            Assert.Equal("<NAME>", keywords.List[1]);
        }


        [Fact]
        public async void TestFilenameWithSpace()
        {
            var et = new ExifTool(new ExifToolOptions());
            var res = (await et.GetTagsAsync("space test.NEF")).ToList();

            Assert.True(res.Count() > 0);
        }


        [Fact]
        public async void TestExifValues()
        {
            var et = new ExifTool(new ExifToolOptions());
            var tags = (await et.GetTagsAsync("DSC_3982.NEF")).ToList();
{'fraction_non_alphanumeric': 0.1328093510681177, 'fraction_numerical': 0.029826682789197905, 'mean_word_length': 1.8905066977285965, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '801756', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1482, 'n_words': 283}