Example #1
0
        public void MutationAttribute_TemplateConstructor_PropertyCheck()
        {
            var attrib = new MutationAttribute("myMutationRoute");

            Assert.AreEqual(GraphCollection.Mutation, attrib.FieldType);
            Assert.AreEqual(false, attrib.IsRootFragment);
            Assert.AreEqual(null, attrib.UnionTypeName);
            Assert.AreEqual("myMutationRoute", attrib.Template);
            Assert.AreEqual(TypeExpressions.Auto, attrib.TypeExpression);
            Assert.AreEqual(0, attrib.Types.Count);
            Assert.AreEqual(FieldResolutionMode.PerSourceItem, attrib.ExecutionMode);
        }
Example #2
0
        public void MutationAttribute_EmptyConstructor_PropertyCheck()
        {
            var attrib = new MutationAttribute();

            Assert.AreEqual(GraphCollection.Mutation, attrib.FieldType);
            Assert.AreEqual(false, attrib.IsRootFragment);
            Assert.AreEqual(null, attrib.UnionTypeName);
            Assert.AreEqual(Constants.Routing.ACTION_METHOD_META_NAME, attrib.Template);
            Assert.AreEqual(TypeExpressions.Auto, attrib.TypeExpression);
            Assert.AreEqual(0, attrib.Types.Count);
            Assert.AreEqual(FieldResolutionMode.PerSourceItem, attrib.ExecutionMode);
        }
Example #3
0
        public void MutationAttribute_UnionConstructor_PropertyCheck()
        {
            var attrib = new MutationAttribute("myField", "myUnionType", typeof(AttributeDataIntegrityTests), typeof(GraphFieldAttribute));

            Assert.AreEqual(GraphCollection.Mutation, attrib.FieldType);
            Assert.AreEqual(false, attrib.IsRootFragment);
            Assert.AreEqual("myUnionType", attrib.UnionTypeName);
            Assert.AreEqual("myField", attrib.Template);
            Assert.AreEqual(TypeExpressions.Auto, attrib.TypeExpression);
            Assert.AreEqual(2, attrib.Types.Count);
            Assert.AreEqual(typeof(AttributeDataIntegrityTests), attrib.Types[0]);
            Assert.AreEqual(typeof(GraphFieldAttribute), attrib.Types[1]);
            Assert.AreEqual(FieldResolutionMode.PerSourceItem, attrib.ExecutionMode);
        }
Example #4
0
        public void MutationAttribute_MultiTypeConstructor_PropertyCheck()
        {
            var attrib = new MutationAttribute(typeof(AttributeDataIntegrityTests), typeof(GraphFieldAttribute));

            Assert.AreEqual(GraphCollection.Mutation, attrib.FieldType);
            Assert.AreEqual(false, attrib.IsRootFragment);
            Assert.AreEqual(null, attrib.UnionTypeName);
            Assert.AreEqual(Constants.Routing.ACTION_METHOD_META_NAME, attrib.Template);
            Assert.AreEqual(TypeExpressions.Auto, attrib.TypeExpression);
            Assert.AreEqual(2, attrib.Types.Count);
            Assert.AreEqual(typeof(AttributeDataIntegrityTests), attrib.Types[0]);
            Assert.AreEqual(typeof(GraphFieldAttribute), attrib.Types[1]);
            Assert.AreEqual(FieldResolutionMode.PerSourceItem, attrib.ExecutionMode);
        }