<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Ploeh.Albedo;
using Xunit.Extensions;

namespace Ploeh.Albedo.UnitTests
{
    public class TypeElementMaterializerTests
    {
        [Fact]
        public void SutIsReflectionElementMaterializer()
        {
            var sut = new TypeElementMaterializer<object>();
            Assert.IsAssignableFrom<IReflectionElementMaterializer<object>>(sut);
        }

        [Theory]
        [InlineData(new object[] { new[] { typeof(Version) } })]
        [InlineData(new object[] { new[] { typeof(AssemblyElement) } })]
        [InlineData(new object[] { new[] { typeof(AssemblyElementTest) } })]
        [InlineData(new object[] { new[] { typeof(AssemblyElement), typeof(Version) } })]
        [InlineData(new object[] { new object[] { typeof(AssemblyElement), "", typeof(Version) } })]
        public void MaterializeTypesReturnsCorrectResult(object[] types)
        {
            var sut = new TypeElementMaterializer<object>();

            var actual = sut.Materialize(types);

            var expected = types
                .OfType<Type>()
                .Select(t => new TypeElement(t))
                .Cast<IReflectionElement>();
            Assert.Equal(expected, actual);
        }
    }
}<commit_msg>Added a Null Guard test.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Ploeh.Albedo;
using Xunit.Extensions;

namespace Ploeh.Albedo.UnitTests
{
    public class TypeElementMaterializerTests
    {
        [Fact]
        public void SutIsReflectionElementMaterializer()
        {
            var sut = new TypeElementMaterializer<object>();
            Assert.IsAssignableFrom<IReflectionElementMaterializer<object>>(sut);
        }

        [Theory]
        [InlineData(new object[] { new[] { typeof(Version) } })]
        [InlineData(new object[] { new[] { typeof(AssemblyElement) } })]
        [InlineData(new object[] { new[] { typeof(AssemblyElementTest) } })]
        [InlineData(new object[] { new[] { typeof(AssemblyElement), typeof(Version) } })]
        [InlineData(new object[] { new object[] { typeof(AssemblyElement), "", typeof(Version) } })]
        public void MaterializeTypesReturnsCorrectResult(object[] types)
        {
            var sut = new TypeElementMaterializer<object>();

            var actual = sut.Materialize(types);

            var expected = types
                .OfType<Type>()
                .Select(t => new TypeElement(t))
                .Cast<IReflectionElement>();
            Assert.Equal(expected, actual);
        }

        [Fact]
        public void MaterializeNullSourceThrows()
        {
            var sut = new TypeElementMaterializer<object>();
            Assert.Throws<ArgumentNullException>(() => sut.Materialize(null));
        }
    }
}
{'fraction_non_alphanumeric': 0.12263176024801929, 'fraction_numerical': 0.0, 'mean_word_length': 2.634543178973717, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 20, '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': '2554510', 'n_tokens_mistral': 795, 'n_tokens_neox': 786, 'n_words': 160}