<commit_before>﻿// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Xunit;

namespace System.Reflection.Tests
{
    public static class ReflectionTypeLoadExceptionTests
    {
        [Fact]
        public static void NullExceptionsNoNullPointerException()
        {
            Type[] types = new Type[1];
            Exception[] exceptions = new Exception[1];
            ReflectionTypeLoadException rtle = new ReflectionTypeLoadException(types, exceptions, "Null elements in Exceptions array");
            Assert.NotNull(rtle.ToString());
            Assert.NotNull(rtle.Message);
            Assert.Equal(rtle.LoaderExceptions.Length, 1);
            Assert.Equal(rtle.LoaderExceptions[0], null);
            Assert.Equal(rtle.Types.Length, 1);
            Assert.Equal(rtle.Types[0], null);
        }

        [Fact]
        public static void NullArgumentsNoNullPointerException()
        {
            ReflectionTypeLoadException rtle = new ReflectionTypeLoadException(null, null, "Null arguments");
            Assert.NotNull(rtle.ToString());
            Assert.NotNull(rtle.Message);
            Assert.Equal(rtle.LoaderExceptions, null);
            Assert.Equal(rtle.Types, null);
        }
    }
}<commit_msg>Fix ReflectionTypeLoadExceptionTests (#26166)<commit_after>﻿// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Xunit;

namespace System.Reflection.Tests
{
    public static class ReflectionTypeLoadExceptionTests
    {
        [Fact]
        public static void NullExceptionsNoNullPointerException()
        {
            Type[] types = new Type[1];
            Exception[] exceptions = new Exception[1];
            ReflectionTypeLoadException rtle = new ReflectionTypeLoadException(types, exceptions, "Null elements in Exceptions array");
            Assert.NotNull(rtle.ToString());
            Assert.NotNull(rtle.Message);
            Assert.Equal(1, rtle.LoaderExceptions.Length);
            Assert.Null(rtle.LoaderExceptions[0]);
            Assert.Equal(1, rtle.Types.Length);
            Assert.Null(rtle.Types[0]);
        }

        [Fact]
        public static void NullArgumentsNoNullPointerException()
        {
            ReflectionTypeLoadException rtle = new ReflectionTypeLoadException(null, null, "Null arguments");
            Assert.NotNull(rtle.ToString());
            Assert.NotNull(rtle.Message);
            Assert.Null(rtle.LoaderExceptions);
            Assert.Null(rtle.Types);
        }
    }
}
{'fraction_non_alphanumeric': 0.09215262778977681, 'fraction_numerical': 0.006119510439164867, 'mean_word_length': 2.5765765765765765, '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': '3526120', 'n_tokens_mistral': 707, 'n_tokens_neox': 692, 'n_words': 186}