public void TypeSlimToTypeConverter_Resolve_ThrowsInvalidOperation()
        {
            var visitor     = new TypeSlimToTypeConverter(DefaultReflectionProvider.Instance);
            var intTypeSlim = typeof(int).ToTypeSlim();

            visitor.MapType(intTypeSlim, typeof(string));
            Assert.ThrowsException <InvalidOperationException>(() => visitor.MapType(intTypeSlim, typeof(long)));
        }
        public void TypeSlimToTypeConverter_ArgumentChecks()
        {
            var converter = new TypeSlimToTypeConverter(DefaultReflectionProvider.Instance);

            AssertEx.ThrowsException <ArgumentNullException>(() => converter.Visit(type: null), ex => Assert.AreEqual(ex.ParamName, "type"));
            AssertEx.ThrowsException <ArgumentNullException>(() => converter.MapType(typeSlim: null, type: null), ex => Assert.AreEqual(ex.ParamName, "typeSlim"));
            AssertEx.ThrowsException <ArgumentNullException>(() => converter.MapType(SlimType, type: null), ex => Assert.AreEqual(ex.ParamName, "type"));
        }
        public void TypeSlimToTypeConverter_Resolve_Success()
        {
            var typeToSlim   = new TypeToTypeSlimConverter();
            var visitor      = new TypeSlimToTypeConverter(DefaultReflectionProvider.Instance);
            var longTypeSlim = typeToSlim.Visit(typeof(long));

            visitor.MapType(longTypeSlim, typeof(int));
            var longType = visitor.Visit(longTypeSlim);

            Assert.AreEqual(typeof(int), longType);
            visitor.MapType(longTypeSlim, typeof(int));
        }