public void AddNewFieldDescriptionWithOldName() { // Setup test var origName = "zCustom Field"; var newName = "zNew Custom Field User label"; CreateCustomFieldAndRelabel(origName, newName); var firstFlid = m_mdc.GetFieldId2(1, origName, true); var secondUserLabel = "unrelatedUserLabel"; var customField2 = new FieldDescription(Cache) { Class = 1, Name = origName, Userlabel = secondUserLabel, Type = CellarPropertyType.String }; // SUT customField2.UpdateCustomField(); // should change Name slightly // Verify var newExpectedName = origName + "1"; var secondFlid = m_mdc.GetFieldId2(customField2.Class, newExpectedName, true); Assert.AreNotEqual(0, secondFlid, "Field not, or incorrectly, installed."); var actualNewName = m_mdc.GetFieldName(secondFlid); Assert.AreEqual(newExpectedName, actualNewName, string.Format("Field Name should be changed to {0}.", newExpectedName)); Assert.AreEqual(secondUserLabel, m_mdc.GetFieldLabel(secondFlid), "User label shouldn't change."); // Cleanup m_mdc.DeleteCustomField(firstFlid); m_mdc.DeleteCustomField(secondFlid); }
/// <summary> Gets the user label of a field. </summary> /// <param name='luFlid'>Field identification number. In the database, this corresponds to the "Id" /// column in the Field$ table. </param> /// <returns>Points to the output Label of the field. In the database, this /// corresponds to the "UserLabel" column in the Field$ table.</returns> public virtual string GetFieldLabel(int luFlid) { return(m_metaDataCache.GetFieldLabel(luFlid)); }