Exemplo n.º 1
0
        public void testDateChanged()
        {
            GEDCOMDate instance = GEDCOMDate.CreateByFormattedStr("31/11/1980", true);
            //instance.dateChanged();
            string result = instance.GetUDN().ToString();

            Assert.AreEqual("1980/12/01", result);
        }
Exemplo n.º 2
0
        public void testGetUDN()
        {
            GEDCOMDate instance  = GEDCOMDate.CreateByFormattedStr("20/12/1980", true);
            UDN        expResult = new UDN(UDNCalendarType.ctGregorian, 1980, 12, 20);
            UDN        result    = instance.GetUDN();
            bool       resu2     = expResult.Equals(result);

            Assert.IsTrue(resu2);
            Assert.AreEqual(expResult, result); // TODO Assert.AreEqual supposedly invokes .equals(), so why does this fail?
        }
Exemplo n.º 3
0
        public override UDN GetUDN()
        {
            UDN result;

            if (fDateFrom.StringValue != "" && fDateTo.StringValue == "")
            {
                result = UDN.CreateAfter(fDateFrom.GetUDN());
            }
            else if (fDateFrom.StringValue == "" && fDateTo.StringValue != "")
            {
                result = UDN.CreateBefore(fDateTo.GetUDN());
            }
            else if (fDateFrom.StringValue != "" && fDateTo.StringValue != "")
            {
                result = UDN.CreateBetween(fDateFrom.GetUDN(), fDateTo.GetUDN());
            }
            else
            {
                result = UDN.CreateEmpty();
            }

            return(result);
        }
Exemplo n.º 4
0
        public static UDN GetUDNByFormattedStr(string dateStr, GEDCOMCalendar calendar, bool aException = false)
        {
            GEDCOMDate dtx = GEDCOMDate.CreateByFormattedStr(dateStr, calendar, aException);

            return((dtx != null) ? dtx.GetUDN() : UDN.CreateEmpty());
        }