<commit_before>﻿using System.Collections.Generic;
using Arkivverket.Arkade.Core;
using Arkivverket.Arkade.Core.Addml;
using Arkivverket.Arkade.Core.Addml.Definitions;
using Arkivverket.Arkade.Core.Addml.Definitions.DataTypes;
using Arkivverket.Arkade.Core.Addml.Processes;
using Arkivverket.Arkade.Test.Core.Addml.Builders;
using FluentAssertions;
using Xunit;

namespace Arkivverket.Arkade.Test.Core.Addml.Processes
{
    public class ControlNotNullTest
    {
        [Fact]
        public void ShouldReportNullValues()
        {
            List<string> nullValues = new List<string>
            {
                "null"
            };
            AddmlFieldDefinition fieldDefinition1 = new AddmlFieldDefinitionBuilder()
                .WithDataType(new StringDataType(null, nullValues))
                .Build();
            AddmlFieldDefinition fieldDefinition2 = new AddmlFieldDefinitionBuilder()
                .WithDataType(new StringDataType(null, nullValues))
                .Build();

            FlatFile flatFile = new FlatFile(fieldDefinition1.GetAddmlFlatFileDefinition());

            ControlNotNull test = new ControlNotNull();
            test.Run(flatFile);
            test.Run(new Field(fieldDefinition1, "A"));
            test.Run(new Field(fieldDefinition1, "null"));
            test.Run(new Field(fieldDefinition1, "B"));
            test.Run(new Field(fieldDefinition1, "C"));
            test.Run(new Field(fieldDefinition2, "A"));
            test.Run(new Field(fieldDefinition2, "B"));
            test.Run(new Field(fieldDefinition2, "C"));
            test.EndOfFile();

            TestRun testRun = test.GetTestRun();
            testRun.IsSuccess().Should().BeTrue();
            testRun.Results.Count.Should().Be(1);
            testRun.Results[0].Location.ToString().Should().Be(fieldDefinition1.GetIndex().ToString());
            testRun.Results[0].Message.Should().Be("NULL-verdier finnes");
        }
    }
}<commit_msg>Update unit test<commit_after>﻿using System.Collections.Generic;
using Arkivverket.Arkade.Core;
using Arkivverket.Arkade.Core.Addml;
using Arkivverket.Arkade.Core.Addml.Definitions;
using Arkivverket.Arkade.Core.Addml.Definitions.DataTypes;
using Arkivverket.Arkade.Core.Addml.Processes;
using Arkivverket.Arkade.Test.Core.Addml.Builders;
using FluentAssertions;
using Xunit;

namespace Arkivverket.Arkade.Test.Core.Addml.Processes
{
    public class ControlNotNullTest
    {
        [Fact]
        public void ShouldReportNullValues()
        {
            List<string> nullValues = new List<string>
            {
                "null"
            };
            AddmlFieldDefinition fieldDefinition1 = new AddmlFieldDefinitionBuilder()
                .WithDataType(new StringDataType(null, nullValues))
                .Build();
            AddmlFieldDefinition fieldDefinition2 = new AddmlFieldDefinitionBuilder()
                .WithDataType(new StringDataType(null, nullValues))
                .Build();

            FlatFile flatFile = new FlatFile(fieldDefinition1.GetAddmlFlatFileDefinition());

            ControlNotNull test = new ControlNotNull();
            test.Run(flatFile);
            test.Run(new Field(fieldDefinition1, "A"));
            test.Run(new Field(fieldDefinition1, "null"));
            test.Run(new Field(fieldDefinition1, "B"));
            test.Run(new Field(fieldDefinition1, "C"));
            test.Run(new Field(fieldDefinition2, "A"));
            test.Run(new Field(fieldDefinition2, "B"));
            test.Run(new Field(fieldDefinition2, "C"));
            test.EndOfFile();

            TestRun testRun = test.GetTestRun();
            testRun.IsSuccess().Should().BeFalse();
            testRun.Results.Count.Should().Be(1);
            testRun.Results[0].Location.ToString().Should().Be(fieldDefinition1.GetIndex().ToString());
            testRun.Results[0].Message.Should().Be("NULL-verdier finnes");
        }
    }
}
{'fraction_non_alphanumeric': 0.11642094560244026, 'fraction_numerical': 0.0071174377224199285, 'mean_word_length': 2.6067827681026583, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3836405', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1101, 'n_words': 176}