public void TestGetDisplayName()
        {
            //nominal case - display name already set in non-date custom type
            IDataElement dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem("This is a preset Display Name"), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, "This is my doc type"));
            ConditionDisplayParameterCustomPropertyValue customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.Text, dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            Assert.AreEqual("This is my doc type", customPropertyValueParam.GetDisplayName(), "unexpected Text - display name should be the same as dataElement");

            ////display name already set in date custom type. In this case we shouldn't use the display name, in case the 
            ////locale of the machine has changed
            //dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem("This is a preset Display Name"), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, "2006-05-22 00:00:00Z"));
            //customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.Date, dataElement, this.Callback);
            ////this will fail if the locale of the test machine changes, but is correct for UK.
            //Assert.AreEqual("22/05/2006", customPropertyValueParam.GetDisplayName(), "unexpected displayname");
            
            //data items in text custom property type - display value of item
            dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, "This is some text"));
            customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.Text, dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            dataElement.DisplayName.Value = "";
            Assert.AreEqual(0, dataElement.DisplayName.Value.Length, "unexpected dataelement.displayname.value");
            Assert.AreEqual("This is some text", customPropertyValueParam.GetDisplayName(), "unexpected displayname");
            Assert.AreEqual("This is some text", dataElement.DisplayName.Value, "unexpected dataelement.displayname.value");

            ////data items in date custom type - in this case, should get short date representation of a UTC time
            //dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, "2006-05-22 00:00:00Z"));
            //customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.Date, dataElement, this.Callback);
            //dataElement.DisplayName.Value = "";
            //Assert.AreEqual(0, dataElement.DisplayName.Value.Length, "unexpected dataelement.displayname.value");
            ////this will fail if the locale of the test machine changes, but is correct for UK.
            //Assert.AreEqual("22/05/2006", customPropertyValueParam.GetDisplayName(), "unexpected displayname");
            //Assert.AreEqual("22/05/2006", dataElement.DisplayName.Value, "unexpected dataelement.displayname.value");

            //data items in number custom property type - display value of item
            dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, "12345678"));
            customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.Number, dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            dataElement.DisplayName.Value = "";
            Assert.AreEqual(0, dataElement.DisplayName.Value.Length, "unexpected dataelement.displayname.value");
            Assert.AreEqual("12345678", customPropertyValueParam.GetDisplayName(), "unexpected displayname");
            Assert.AreEqual("12345678", dataElement.DisplayName.Value, "unexpected dataelement.displayname.value");

            //data items in YesNo custom type - in this case, should get Yes or No for True or False values
            dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, Boolean.TrueString));
            customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.YesNo, dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            dataElement.DisplayName.Value = "";
            Assert.AreEqual(0, dataElement.DisplayName.Value.Length, "unexpected dataelement.displayname.value");
            Assert.AreEqual("Yes", customPropertyValueParam.GetDisplayName(), "unexpected displayname");
            Assert.AreEqual("Yes", dataElement.DisplayName.Value, "unexpected dataelement.displayname.value");
            dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, Boolean.FalseString));
            customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.YesNo, dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            dataElement.DisplayName.Value = "";
            Assert.AreEqual(0, dataElement.DisplayName.Value.Length, "unexpected dataelement.displayname.value");
            Assert.AreEqual("No", customPropertyValueParam.GetDisplayName(), "unexpected displayname");
            Assert.AreEqual("No", dataElement.DisplayName.Value, "unexpected dataelement.displayname.value");
            
            //no data
            dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, ""));
            Assert.AreEqual(0, dataElement.DisplayName.Value.Length, "unexpected length on dataelement.displayname.value");
            customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.Text, dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            Assert.AreEqual(Properties.Resources.IDS_EXPRESSION_PARAM_CUSTOMPROPERTYVALUE_DEFAULT, customPropertyValueParam.GetDisplayName(), "unexpected displayname");
            Assert.AreEqual(Properties.Resources.IDS_EXPRESSION_PARAM_CUSTOMPROPERTYVALUE_DEFAULT, dataElement.DisplayName.Value, "unexpected length on dataelement.displayname.value");

            //invalid format for data
            dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.String, new PolicyObjectCollection<IDataItem>());
            customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.Text, null, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            customPropertyValueParam.Object = dataElement;
            try
            {
                string displayName = customPropertyValueParam.GetDisplayName();
                Assert.IsTrue(false, "didn't throw on invalid data format");
            }
            catch (PolicyDesignerException)
            {
                Assert.IsTrue(true);
            }
            catch
            {
                Assert.IsTrue(false, "Unexpected exception");
            }

            //no data
            customPropertyValueParam = new ConditionDisplayParameterCustomPropertyValue(CustomPropertyType.Text, null, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            try
            {
                string displayName = customPropertyValueParam.GetDisplayName();
                Assert.IsTrue(false, "didn't throw on empty data");
            }
            catch (PolicyDesignerException)
            {
                Assert.IsTrue(true);
            }
            catch
            {
                Assert.IsTrue(false, "Unexpected exception");
            }
        }