示例#1
0
 /// <summary>
 /// Indicates whether the contents of the given LongText object
 /// equal the contents of this object
 /// </summary>
 /// <param name="obj">The LongText object to compare with</param>
 /// <returns>Returns true if equal</returns>
 public override bool Equals(object obj)
 {
     if (obj is LongText)
     {
         LongText compareTo = (LongText)obj;
         return(compareTo.Value.Equals(_longTextValue));
     }
     else
     {
         return(false);
     }
 }
示例#2
0
 public void TestEquals()
 {
     LongText longText1 = new LongText("test");
     LongText longText2 = new LongText("test");
     Assert.IsTrue(longText1.Equals(longText2));
 }
示例#3
0
        public void TestHashCode()
        {
            LongText longText = new LongText("test");

            if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86")
            {
                Assert.AreEqual(-354185609, longText.GetHashCode());
            }
            else
            {
                Assert.AreEqual(-871206010, longText.GetHashCode());
            }
        }
示例#4
0
 public void TestSettingValue()
 {
     LongText longText = new LongText("test");
     longText.Value = "newtest";
     Assert.IsTrue(longText.Value.Equals("newtest"));
 }
示例#5
0
 public void TestLoadingConstructor()
 {
     LongText longText = new LongText("test");
     Assert.IsTrue(longText.Value.Equals("test"));
 }
示例#6
0
        public void TestPropertyValue()
        {
            //---------------Set up test pack-------------------
            IBusinessObject bo = _itsClassDef.CreateNewBusinessObject();
            LongText longText = new LongText("test");
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            bo.SetPropertyValue("TestProp", longText);
            object actualValue = bo.GetPropertyValue("TestProp");

            //---------------Test Result -----------------------
            Assert.IsNotNull(actualValue);
            Assert.IsInstanceOf(typeof (LongText), actualValue);
            Assert.AreSame(longText, actualValue);
        }
示例#7
0
        public void Test_BOPropGeneralDataMapper_TryParseCustomProperty_InheritedCustomProperty()
        {
            //---------------Set up test pack-------------------
            LongText longText = new LongText("test");
            GeneralDataMapper generalDataMapper = new GeneralDataMapper(typeof(CustomProperty));
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            object returnValue;
            generalDataMapper.TryParsePropValue(longText, out returnValue);
            //---------------Test Result -----------------------
            Assert.IsNotNull(returnValue);
            Assert.AreSame(longText, returnValue);
        }
示例#8
0
 public void TestToString()
 {
     LongText longText = new LongText("test");
     Assert.AreEqual("test", longText.ToString());
 }