public void TestCreateField() { createdField = contactsFactory.CreateField() .SetName("FieldX") .SetType(Field.TextType) .Execute(); Assert.IsNotNull(createdField.Id); Assert.AreEqual("FieldX", createdField.Name); }
public void Initialize() { var fields = contactsFactory.ListFields().Execute(); foreach (var field in fields.List) { if ("FieldX".Equals(field.Name)) createdField = field; else if ("FieldY".Equals(field.Name)) contactsFactory.DeleteField(field.Id).Execute(); } if (createdField == null) { createdField = contactsFactory.CreateField() .SetName("FieldX") .SetType(Field.TextType) .Execute(); } }