protected override string GetStringValue() { string result; if (!fDateFrom.IsEmpty() && !fDateTo.IsEmpty()) { result = string.Concat("FROM ", fDateFrom.StringValue, " TO ", fDateTo.StringValue); } else { if (!fDateFrom.IsEmpty()) { result = "FROM " + fDateFrom.StringValue; } else { if (!fDateTo.IsEmpty()) { result = "TO " + fDateTo.StringValue; } else { result = ""; } } } return(result); }
protected override string GetStringValue() { string result; if (!fDateAfter.IsEmpty() && !fDateBefore.IsEmpty()) { result = string.Concat(GEDCOMDateRangeArray[2], " ", fDateAfter.StringValue, " ", GEDCOMDateRangeArray[3], " ", fDateBefore.StringValue); } else { if (!fDateAfter.IsEmpty()) { result = GEDCOMDateRangeArray[0] + " " + fDateAfter.StringValue; } else { if (!fDateBefore.IsEmpty()) { result = GEDCOMDateRangeArray[1] + " " + fDateBefore.StringValue; } else { result = ""; } } } return(result); }
public void testIsEmpty() { GEDCOMDate instance = new GEDCOMDate(null, null, "", ""); bool expResult = true; bool result = instance.IsEmpty(); Assert.AreEqual(expResult, result); }