<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using System.Diagnostics;
using System.IO;
using System.Reflection;

namespace Grib.Api.Tests
{
    [TestFixture]
    public class Get
    {
        [Test]
        public void TestGetGrib2 ()
        {
            using (GribFile file = new GribFile(Settings.REDUCED_LATLON_GRB2))
            {
                using (var msg = file.First())
                {

                    double latitudeOfFirstGridPointInDegrees = msg["latitudeOfFirstGridPointInDegrees"].AsDouble();
                    Assert.AreEqual(latitudeOfFirstGridPointInDegrees, 90);
                    double longitudeOfFirstGridPointInDegrees = msg["longitudeOfFirstGridPointInDegrees"].AsDouble();
                    Assert.AreEqual(longitudeOfFirstGridPointInDegrees, 0);
                    double latitudeOfLastGridPointInDegrees = msg["latitudeOfLastGridPointInDegrees"].AsDouble();
                    Assert.AreEqual(latitudeOfLastGridPointInDegrees, -90);
                    double longitudeOfLastGridPointInDegrees = msg["longitudeOfLastGridPointInDegrees"].AsDouble();
                    Assert.AreEqual(longitudeOfLastGridPointInDegrees, 359.64);

                    double jDirectionIncrementInDegrees = msg["jDirectionIncrementInDegrees"].AsDouble();
                    Assert.AreEqual(jDirectionIncrementInDegrees, 0.36);
                    double iDirectionIncrementInDegrees = msg["iDirectionIncrementInDegrees"].AsDouble();
                    Assert.AreEqual(iDirectionIncrementInDegrees, -1.0E+100);

                    int numberOfPointsAlongAParallel = msg["numberOfPointsAlongAParallel"].AsInt();
                    Assert.AreEqual(numberOfPointsAlongAParallel, -1);
                    int numberOfPointsAlongAMeridian = msg["numberOfPointsAlongAMeridian"].AsInt();
                    Assert.AreEqual(numberOfPointsAlongAMeridian, 501);

                    string packingType = msg["packingType"].AsString();
                    Assert.AreEqual("grid_simple", packingType);
                }
            }
        }
    }
}<commit_msg>Added NativeType test<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using Grib.Api.Interop;

namespace Grib.Api.Tests
{
    [TestFixture]
    public class Get
    {
        [Test]
        public void TestGetGrib2 ()
        {
            using (GribFile file = new GribFile(Settings.REDUCED_LATLON_GRB2))
            {
                using (var msg = file.First())
                {

                    double latitudeOfFirstGridPointInDegrees = msg["latitudeOfFirstGridPointInDegrees"].AsDouble();
                    Assert.AreEqual(latitudeOfFirstGridPointInDegrees, 90);
                    Assert.AreEqual(msg["latitudeOfFirstGridPointInDegrees"].NativeType, GribValueType.Double);

                    double longitudeOfFirstGridPointInDegrees = msg["longitudeOfFirstGridPointInDegrees"].AsDouble();
                    Assert.AreEqual(longitudeOfFirstGridPointInDegrees, 0);
                    double latitudeOfLastGridPointInDegrees = msg["latitudeOfLastGridPointInDegrees"].AsDouble();
                    Assert.AreEqual(latitudeOfLastGridPointInDegrees, -90);
                    double longitudeOfLastGridPointInDegrees = msg["longitudeOfLastGridPointInDegrees"].AsDouble();
                    Assert.AreEqual(longitudeOfLastGridPointInDegrees, 359.64);

                    double jDirectionIncrementInDegrees = msg["jDirectionIncrementInDegrees"].AsDouble();
                    Assert.AreEqual(jDirectionIncrementInDegrees, 0.36);
                    double iDirectionIncrementInDegrees = msg["iDirectionIncrementInDegrees"].AsDouble();
                    Assert.AreEqual(iDirectionIncrementInDegrees, -1.0E+100);

                    int numberOfPointsAlongAParallel = msg["numberOfPointsAlongAParallel"].AsInt();
                    Assert.AreEqual(numberOfPointsAlongAParallel, -1);
                    int numberOfPointsAlongAMeridian = msg["numberOfPointsAlongAMeridian"].AsInt();
                    Assert.AreEqual(numberOfPointsAlongAMeridian, 501);

                    string packingType = msg["packingType"].AsString();
                    Assert.AreEqual("grid_simple", packingType);
                    Assert.AreEqual(msg["packingType"].NativeType, GribValueType.String);
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08670270270270271, 'fraction_numerical': 0.010378378378378378, 'mean_word_length': 2.467766116941529, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '394821', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1186, 'n_words': 172}