Exemple #1
0
        public void GraphType_SettingPreventionFlag()
        {
            var attrib = new GraphTypeAttribute("bob");

            attrib.PreventAutoInclusion = true;
            Assert.AreEqual(true, attrib.PreventAutoInclusion);
        }
Exemple #2
0
        public void GraphType_SettingDeclarationReqs()
        {
            var attrib = new GraphTypeAttribute("bob");

            attrib.FieldDeclarationRequirements = TemplateDeclarationRequirements.Method;
            Assert.AreEqual(true, attrib.RequirementsWereDeclared);
            Assert.AreEqual(TemplateDeclarationRequirements.Method, attrib.FieldDeclarationRequirements);
        }
Exemple #3
0
        private static Type getGraphType(GraphTypeAttribute graphTypeAttribute, Type type)
        {
            if (graphTypeAttribute == null)
            {
                return(type != null?GetGraphType(type) : null);
            }

            return(graphTypeAttribute.Type);
        }
Exemple #4
0
        public void GraphType_NamesAreTrimmed()
        {
            var attrib = new GraphTypeAttribute("bob   ", "   jane  \r");

            Assert.AreEqual("bob", attrib.Name);
            Assert.AreEqual("jane", attrib.InputName);
            Assert.AreEqual(false, attrib.PreventAutoInclusion);
            Assert.AreEqual(false, attrib.RequirementsWereDeclared);
            Assert.AreEqual(TemplateDeclarationRequirements.None, attrib.FieldDeclarationRequirements);
        }
Exemple #5
0
        public void GraphType_NameWithInputNameConstructor_PropertyCheck()
        {
            var attrib = new GraphTypeAttribute("bob", "jane");

            Assert.AreEqual("bob", attrib.Name);
            Assert.AreEqual("jane", attrib.InputName);
            Assert.AreEqual(false, attrib.PreventAutoInclusion);
            Assert.AreEqual(false, attrib.RequirementsWereDeclared);
            Assert.AreEqual(TemplateDeclarationRequirements.None, attrib.FieldDeclarationRequirements);
        }
Exemple #6
0
        private void ProcessGraphTypeAttribute(GraphTypeAttribute attribute)
        {
            if (String.IsNullOrEmpty(attribute.Name) == false)
            {
                Name = attribute.Name;
            }

            IsInput = attribute.IsInput;
            IsDescriptionGenerated = attribute.IsDescriptionGenerated;
        }
Exemple #7
0
 public TypeDefinition(Type type, GraphTypeAttribute attribute)
     : this(type)
 {
     ProcessGraphTypeAttribute(attribute);
 }