<commit_before>namespace MassTransit.Tests
{
    using System;
    using NUnit.Framework;
    using TestFramework.Examples.Messages;

    [TestFixture]
    public class MessageUrnSpecs
    {
        
        [Test]
        public void SimpleMessage()
        {
            var urn = new MessageUrn(typeof (Ping));
            Assert.AreEqual(urn.AbsolutePath, "message:MassTransit.TestFramework.Examples.Messages:Ping");
        }

        [Test]
        public void SimpleMessageLoopback()
        {
            LoopbackTestMessage(typeof (Ping));
        }

        [Test]
        public void NestedMessage()
        {
            var urn = new MessageUrn(typeof (X));
            Assert.AreEqual(urn.AbsolutePath, "message:MassTransit.Tests:MessageUrnSpecs+X");
        }

        [Test]
        public void NestedMessageLoopback()
        {
            LoopbackTestMessage(typeof (X));
        }

        [Test]
        public void OpenGenericMessage()
        {
            var urn = new MessageUrn(typeof (G<>));
            var expected = new Uri("urn:message:MassTransit.Tests:G[[]]");
            Assert.AreEqual(expected.AbsolutePath, urn.AbsolutePath);
        }

        [Test]
        public void OpenGenericMessageLoopback()
        {
            LoopbackTestMessage(typeof (G<>));
        }

        [Test]
        public void ClosedGenericMessage()
        {
            var urn = new MessageUrn(typeof (G<Ping>));
            var expected = new Uri("urn:message:MassTransit.Tests:G[[MassTransit.TestFramework.Examples.Messages:Ping]]");
            Assert.AreEqual(expected.AbsolutePath,urn.AbsolutePath) ;
        }

        [Test]
        public void ClosedGenericMessageLoopback()
        {
            LoopbackTestMessage(typeof (G<Ping>));
        }

        private static void LoopbackTestMessage(Type messageType)
        {
            var urn = new MessageUrn(messageType);
            var recreatedMessageType = urn.GetType(throwOnError: true, ignoreCase: true);
            Assert.That(recreatedMessageType, Is.EqualTo(messageType));
        }

        class X{}
    }
    public class G<T>{}
}<commit_msg>More MessageUrn loopback tests<commit_after>namespace MassTransit.Tests
{
    using System;
    using NUnit.Framework;
    using TestFramework.Examples.Messages;

    [TestFixture]
    public class MessageUrnSpecs
    {
        
        [Test]
        public void SimpleMessage()
        {
            var urn = new MessageUrn(typeof (Ping));
            Assert.AreEqual(urn.AbsolutePath, "message:MassTransit.TestFramework.Examples.Messages:Ping");
        }

        [Test]
        public void SimpleMessageLoopback()
        {
            LoopbackTestMessage(typeof (Ping));
        }

        [Test]
        public void NestedMessage()
        {
            var urn = new MessageUrn(typeof (X));
            Assert.AreEqual(urn.AbsolutePath, "message:MassTransit.Tests:MessageUrnSpecs+X");
        }

        [Test]
        public void NestedMessageLoopback()
        {
            LoopbackTestMessage(typeof (X));
        }

        [Test]
        public void OpenGenericMessage()
        {
            var urn = new MessageUrn(typeof (G<>));
            var expected = new Uri("urn:message:MassTransit.Tests:G[[]]");
            Assert.AreEqual(expected.AbsolutePath, urn.AbsolutePath);
        }

        [Test]
        public void OpenGenericMessageLoopback()
        {
            LoopbackTestMessage(typeof (G<>));
        }

        [Test]
        public void OpenGenericTupleMessage()
        {
            var urn = new MessageUrn(typeof (H<,>));
            var expected = new Uri("urn:message:MassTransit.Tests:H[[],[]]");
            Assert.AreEqual(expected.AbsolutePath, urn.AbsolutePath);
        }

        [Test]
        public void OpenGenericTupleMessageLoopback()
        {
            LoopbackTestMessage(typeof (H<,>));
        }

        [Test]
        public void ClosedGenericMessage()
        {
            var urn = new MessageUrn(typeof (G<Ping>));
            var expected = new Uri("urn:message:MassTransit.Tests:G[[MassTransit.TestFramework.Examples.Messages:Ping]]");
            Assert.AreEqual(expected.AbsolutePath,urn.AbsolutePath) ;
        }

        [Test]
        public void ClosedGenericMessageLoopback()
        {
            LoopbackTestMessage(typeof (G<Ping>));
        }

        [Test]
        public void ClosedGenericTupleMessage()
        {
            var urn = new MessageUrn(typeof (H<Ping, Ping>));
            var expected = new Uri("urn:message:MassTransit.Tests:H[[MassTransit.TestFramework.Examples.Messages:Ping],[MassTransit.TestFramework.Examples.Messages:Ping]]");
            Assert.AreEqual(expected.AbsolutePath, urn.AbsolutePath);
        }

        [Test]
        public void ClosedGenericTupleMessageLoopback()
        {
            LoopbackTestMessage(typeof (H<Ping, Ping>));
        }

        private static void LoopbackTestMessage(Type messageType)
        {
            var urn = new MessageUrn(messageType);
            var recreatedMessageType = urn.GetType(throwOnError: true, ignoreCase: true);
            Assert.AreEqual(recreatedMessageType, messageType);
        }

        class X{}
    }
    public class G<T>{}
    public class H<T1,T2>{}
}
{'fraction_non_alphanumeric': 0.10446343779677113, 'fraction_numerical': 0.0003798670465337132, 'mean_word_length': 2.054524361948956, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '5550925', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1451, 'n_words': 268}