示例#1
0
        public void testGetStringValue()
        {
            GEDCOMDate instance = new GEDCOMDate(null, null, "", "");

            instance.SetJulian(1, 3, 1980);
            Assert.AreEqual("@#DJULIAN@ 01 MAR 1980", instance.StringValue);
        }
示例#2
0
        public void testSetJulian_3args()
        {
            int        day      = 20;
            int        month    = 12;
            int        year     = 1980;
            GEDCOMDate instance = new GEDCOMDate(null, null, "", "");

            instance.SetJulian(day, month, year);
            string result = instance.GetDisplayString(DateFormat.dfYYYY_MM_DD, false, false);

            Assert.AreEqual("1980.12.20", result);
        }
示例#3
0
        public void testGetDisplayStringExt()
        {
            DateFormat format       = DateFormat.dfYYYY_MM_DD;
            bool       showCalendar = true;
            GEDCOMDate instance     = new GEDCOMDate(null, null, "", "");

            instance.SetJulian(20, 12, 1980);
            instance.YearBC = true;
            string expResult = "BC 1980.12.20 [J]";
            bool   sign      = true;
            string result    = instance.GetDisplayStringExt(format, sign, showCalendar);

            Assert.AreEqual(expResult, result);

            instance.Approximated = GEDCOMApproximated.daEstimated;
            expResult             = "~ BC 1980.12.20 [J]";
            result = instance.GetDisplayStringExt(format, sign, showCalendar);
            Assert.AreEqual(expResult, result);
        }
示例#4
0
        public void testGetDisplayString_3args()
        {
            DateFormat format       = DateFormat.dfYYYY_MM_DD;
            bool       includeBC    = true;
            bool       showCalendar = true;
            GEDCOMDate instance     = new GEDCOMDate(null, null, "", "");

            instance.SetJulian(20, 12, 1980);
            instance.YearBC = true;
            string expResult = "BC 1980.12.20 [J]";
            string result    = instance.GetDisplayString(format, includeBC, showCalendar);

            Assert.AreEqual(expResult, result);

            result = instance.GetDisplayString(DateFormat.dfDD_MM_YYYY, true, false);
            Assert.AreEqual("20.12.1980 BC", result);

            result = instance.GetDisplayString(DateFormat.dfYYYY, true, false);
            Assert.AreEqual("BC 1980", result);
        }