public void TestGetDisplayName()
        {
            //nominal case - display name already set
            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, "4096"));
            ConditionDisplayParameterFileSize fileSizeParam = new ConditionDisplayParameterFileSize(dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            Assert.AreEqual("4096", fileSizeParam.GetDisplayName(), "unexpected displayname - display name should be same as dataElement");

            //data items in data item
            dataElement.DisplayName.Value = "";
            Assert.AreEqual(0, dataElement.DisplayName.Value.Length, "unexpected dataelement.displayname.value");
            Assert.AreEqual("4096", fileSizeParam.GetDisplayName(), "unexpected displayname");
            Assert.AreEqual("4096", 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");
            fileSizeParam = new ConditionDisplayParameterFileSize(dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            Assert.AreEqual(Properties.Resources.IDS_EXPRESSION_PARAM_FILESIZE_DEFAULT, fileSizeParam.GetDisplayName(), "unexpected displayname");
            Assert.AreEqual(Properties.Resources.IDS_EXPRESSION_PARAM_FILESIZE_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>());
            fileSizeParam = new ConditionDisplayParameterFileSize(null, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            fileSizeParam.Object = dataElement;
            try
            {
                string displayName = fileSizeParam.GetDisplayName();
                Assert.IsTrue(false, "didn't throw on invalid data format");
            }
            catch (PolicyDesignerException)
            {
                Assert.IsTrue(true);
            }
            catch
            {
                Assert.IsTrue(false, "Unexpected exception");
            }

            //no data
            fileSizeParam = new ConditionDisplayParameterFileSize(null, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            try
            {
                string displayName = fileSizeParam.GetDisplayName();
                Assert.IsTrue(false, "didn't throw on empty data");
            }
            catch (PolicyDesignerException)
            {
                Assert.IsTrue(true);
            }
            catch
            {
                Assert.IsTrue(false, "Unexpected exception");
            }
        }
        public void TestConstructor()
        {
            //empty dataElement
            ConditionDisplayParameterFileSize fileSizeParam = new ConditionDisplayParameterFileSize(null, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            Assert.IsTrue(Object.ReferenceEquals(null, fileSizeParam.Object), "unexpected Object");
            Assert.AreEqual(Properties.Resources.IDS_EXPRESSION_PARAM_FILESIZE_DEFAULT, fileSizeParam.Text, "unexpected Text");

            //nominal case with no display name
            IDataElement dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.String, DataItem.CreateDataItem(new NonTranslateableLanguageItem(""), DataType.String, "1024"));
            fileSizeParam = new ConditionDisplayParameterFileSize(dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            Assert.IsTrue(Object.ReferenceEquals(dataElement, fileSizeParam.Object), "unexpected Object");
            Assert.AreEqual("1024", fileSizeParam.Text, "unexpected Text");

            m_callbackCalled = false;
            fileSizeParam.Execute();
            Assert.IsTrue(m_callbackCalled, "Execute not called");

            //nominal case with display name
            dataElement.DisplayName.Value = "This is a display name";
            fileSizeParam = new ConditionDisplayParameterFileSize(dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
            Assert.IsTrue(Object.ReferenceEquals(dataElement, fileSizeParam.Object), "unexpected Object");
            Assert.AreEqual("1024", fileSizeParam.Text, "unexpected Text - display name should be same as dataElement");

            m_callbackCalled = false;
            fileSizeParam.Execute();
            Assert.IsTrue(m_callbackCalled, "Execute not called");

            //invalid format case
            try
            {
                dataElement = new DataElement(Guid.NewGuid(), new NonTranslateableLanguageItem("name"), new NonTranslateableLanguageItem(""), DataType.StringArray, new PolicyObjectCollection<IDataItem>());
                fileSizeParam = new ConditionDisplayParameterFileSize(dataElement, this.Callback, Workshare.Policy.PolicyType.ClientEmail);
                Assert.IsTrue(false, "Didnt throw on invalid dataelement");
            }
            catch (PolicyDesignerException)
            {
                Assert.IsTrue(true);
            }
            catch
            {
                Assert.IsTrue(false, "unexpected exception thrown");
            }
        }
        /// <summary>
        /// Creates hyperlink representation of the editable parameters within the condition
        /// </summary>
        /// <returns>An array of RuleObject objects representing the editable parameters</returns>
        private RuleObject[] GetHyperlinks()
        {
            try
            {
                IDataElement dataElement = null;

                if (m_condition != null)
                {
                    dataElement = m_condition.DataRight;
                }

                m_operatorData = new ConditionDisplayParameterOperator(m_condition, this.EditOperator, m_type);
                m_sizeData = new ConditionDisplayParameterFileSize(dataElement, this.EditFileSizeParameter, m_type);
                RuleObject[] hyperlinks = { m_operatorData, m_sizeData };

                return hyperlinks;
            }
            catch (Exception ex)
            {
                Utilities.ErrorMessage errorMessage = new Utilities.ErrorMessage(
                    "CONDITION_FILESIZE_INVALID",
                    "Workshare.PolicyDesigner.Properties.Resources",
                    System.Reflection.Assembly.GetExecutingAssembly(), ex.Message);
				Logger.LogError(errorMessage.LogString);
				throw new ArgumentException(errorMessage.DisplayString);
            }           
        }