public void should_return_null_when_generic_argument_type_is_not_in_assemblies()
        {
            ClassUnderTest = new GenericParser(new[] { typeof(Bar).Assembly });

            const string typeName = "FubuMVC.Razor.Tests.RazorModel.Binding.Generic<FubuMVC.Razor.Tests.RazorModel.Binding.Baz, System.String>";

            var type = ClassUnderTest.Parse(typeName);

            type.ShouldBeNull();
        }
        public void should_return_null_when_type_is_not_in_assemblies()
        {
            ClassUnderTest = new GenericParser(new[] { typeof(String).Assembly });

            const string typeName = "FubuMVC.Spark.Tests.SparkModel.Binding.Generic<FubuMVC.Spark.Tests.SparkModel.Binding.Baz>";

            var type = ClassUnderTest.Parse(typeName);

            type.ShouldBeNull();
        }
Exemple #3
0
        public Type FindTypeByName(string typeFullName, Action<string> log)
        {
            if (GenericParser.IsGeneric(typeFullName))
            {
                var genericParser = new GenericParser(_graph.AllAssemblies());
                return genericParser.Parse(typeFullName);
            }

            return findClosedTypeByFullName(typeFullName, log);
        }
Exemple #4
0
        public Type FindTypeByName(string typeFullName, Assembly defaultAssembly, Action<string> log)
        {
            if (GenericParser.IsGeneric(typeFullName))
            {
                var genericParser = new GenericParser(_types.Assemblies);
                return genericParser.Parse(typeFullName);
            }

            return findClosedTypeByFullName(typeFullName, defaultAssembly, log);
        }
        public void beforeEach()
        {
            var duplicatedGenericExtraAssembly = generateAssembly("namespace FubuMVC.Razor.Tests.RazorModel.Binding{public class DuplicatedGeneric<T>{} public class Duplicated{} }");

            ClassUnderTest = new GenericParser(new[] { typeof(Bar).Assembly, typeof(String).Assembly, duplicatedGenericExtraAssembly });
        }