Skip to content
This repository
tree: 65ad5735d4
Fetching contributors…

Cannot retrieve contributors at this time

executable file 35 lines (30 sloc) 0.985 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
// ReSharper disable InconsistentNaming
using System;
using NUnit.Framework;

namespace EasyNetQ.Tests
{
[TestFixture]
    public class TypeNameSerializerTests
    {
        const string expectedTypeName = "System_String:mscorlib";

[Test]
        public void Should_serialize_a_type_name()
        {
            var typeName = TypeNameSerializer.Serialize(typeof (string));
            typeName.ShouldEqual(expectedTypeName);
        }

        private const string expectedCustomTypeName = "EasyNetQ_TypeNameSerializer:EasyNetQ";

[Test]
        public void Should_serialize_a_custom_type()
        {
            var typeName = TypeNameSerializer.Serialize(typeof (TypeNameSerializer));
            typeName.ShouldEqual(expectedCustomTypeName);
        }

        public void GetTypeSpike()
        {
            var type = Type.GetType("EasyNetQ.Tests.MyCustomType");
            type.ShouldNotBeNull();
        }
    }
}
// ReSharper restore InconsistentNaming
Something went wrong with that request. Please try again.