public void BatchTypeExtension_TypeConsturctor_PropertyCheck() { var attrib = new BatchTypeExtensionAttribute(typeof(AttributeDataIntegrityTests), "myField"); Assert.AreEqual("myField", attrib.Template); Assert.AreEqual(typeof(AttributeDataIntegrityTests), attrib.TypeToExtend); Assert.AreEqual(0, attrib.Types.Count); Assert.AreEqual(FieldResolutionMode.Batch, attrib.ExecutionMode); }
public void BatchTypeExtension_UnionConstructor_PropertyCheck() { var attrib = new BatchTypeExtensionAttribute(typeof(AttributeDataIntegrityTests), "myField", "myUnionType", typeof(GraphFieldAttribute), typeof(string)); Assert.AreEqual(GraphCollection.Types, attrib.FieldType); Assert.AreEqual(typeof(AttributeDataIntegrityTests), attrib.TypeToExtend); Assert.AreEqual("myField", attrib.Template); Assert.AreEqual("myUnionType", attrib.UnionTypeName); Assert.AreEqual(2, attrib.Types.Count); Assert.AreEqual(typeof(GraphFieldAttribute), attrib.Types[0]); Assert.AreEqual(typeof(string), attrib.Types[1]); Assert.AreEqual(FieldResolutionMode.Batch, attrib.ExecutionMode); }