public void types_are_resolved_against_imported_namespaces()
        {
            var typename = "String";

            OpenRastaPageParserFilter.GetTypeFromCSharpType(typename, new[] { "System" })
            .ShouldBe <string>();
        }
        public void nested_types_are_resolved()
        {
            var typeName = "OpenRasta.Codecs.WebForms.ResourceView<System.Collections.Generic.KeyValuePair<System.String,System.String>>";

            OpenRastaPageParserFilter.GetTypeFromCSharpType(typeName, null)
            .ShouldBe <ResourceView <KeyValuePair <string, string> > >();
        }
        public void names_in_brackets_are_resolved()
        {
            var typeName = "OpenRasta.Codecs.WebForms.ResourceView<System.String>";

            OpenRastaPageParserFilter.GetTypeFromCSharpType(typeName, null)
            .ShouldBe <ResourceView <string> >();
        }
        public void the_title_is_renamed_PageTitle()
        {
            var filter     = new OpenRastaPageParserFilter();
            var attributes = new Hashtable {
                { "Title", "page's title" }, { "Inherits", "MasterView" }
            };

            filter.PreprocessDirective("Page", attributes);
            attributes.ContainsKey("Title")
            .ShouldBeFalse();
            attributes["PageTitle"].ShouldBe("page's title");
        }
        public void the_inherits_attribute_is_rewritten(string typeName, Type expectedType)
        {
            var filter = new OpenRastaPageParserFilter();

            filter.PreprocessDirective("import", new Hashtable {
                { "namespace", typeof(HomeResource).Namespace }
            });
            filter.PreprocessDirective("import", new Hashtable {
                { "namespace", typeof(IList <>).Namespace }
            });
            string rewritten = filter.ParseInheritsAttribute(typeName);

            rewritten.ShouldBe(expectedType.AssemblyQualifiedName);
        }
 public void csharp_names_are_rewritten(string typeName, Type expectedType)
 {
     OpenRastaPageParserFilter.GetTypeFromCSharpType(typeName, new[] { typeof(HomeResource).Namespace, typeof(IList <>).Namespace })
     .ShouldBe(expectedType);
 }
 public void friendlyname_without_generic_type_is_rewritten(string typeName, Type expectedType)
 {
     OpenRastaPageParserFilter.GetTypeFromFriendlyType(typeName, new[] { typeof(HomeResource).Namespace })
     .ShouldBe(expectedType);
 }