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); }
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); }
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); }
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); }