/// <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); } }
public void TestEquals() { LongText longText1 = new LongText("test"); LongText longText2 = new LongText("test"); Assert.IsTrue(longText1.Equals(longText2)); }
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()); } }
public void TestSettingValue() { LongText longText = new LongText("test"); longText.Value = "newtest"; Assert.IsTrue(longText.Value.Equals("newtest")); }
public void TestLoadingConstructor() { LongText longText = new LongText("test"); Assert.IsTrue(longText.Value.Equals("test")); }
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); }
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); }
public void TestToString() { LongText longText = new LongText("test"); Assert.AreEqual("test", longText.ToString()); }