public void SetStrPropValueRgch_NullValue_RemovesProperty() { var tpb = new TsPropsBldr(); Guid guid = Guid.NewGuid(); byte[] bytes = TsStringUtils.GetObjData(guid, FwObjDataTypes.kodtNameGuidHot); tpb.SetStrPropValueRgch((int)FwTextPropType.ktptObjData, bytes, bytes.Length); Assert.That(tpb.StrPropCount, Is.EqualTo(1)); tpb.SetStrPropValueRgch((int)FwTextPropType.ktptObjData, null, 0); Assert.That(tpb.StrPropCount, Is.EqualTo(0)); }
public void SetStrPropValueRgch_EmptyValue_InsertsProperty() { var tpb = new TsPropsBldr(); Assert.That(tpb.StrPropCount, Is.EqualTo(0)); tpb.SetStrPropValueRgch((int)FwTextPropType.ktptObjData, new byte[0], 0); Assert.That(tpb.StrPropCount, Is.EqualTo(1)); Assert.That(tpb.GetStrPropValue((int)FwTextPropType.ktptObjData), Is.Null); }
public void SetStrPropValueRgch_NonEmptyValue_InsertsProperty() { var tpb = new TsPropsBldr(); Assert.That(tpb.StrPropCount, Is.EqualTo(0)); Guid guid = Guid.NewGuid(); byte[] bytes = TsStringUtils.GetObjData(guid, FwObjDataTypes.kodtNameGuidHot); tpb.SetStrPropValueRgch((int)FwTextPropType.ktptObjData, bytes, bytes.Length); Assert.That(tpb.StrPropCount, Is.EqualTo(1)); string str = tpb.GetStrPropValue((int)FwTextPropType.ktptObjData); Assert.That((FwObjDataTypes)str[0], Is.EqualTo(FwObjDataTypes.kodtNameGuidHot)); Assert.That(MiscUtils.GetGuidFromObjData(str.Substring(1)), Is.EqualTo(guid)); }