Ejemplo n.º 1
0
        public void test3()
        {
            int year   = 2020;
            int month  = 1;
            int day    = 20;
            int hour   = 13;
            int minute = 22;
            int second = 0;

            Solar solar = new Solar(year, month, day, hour, minute, second);
            Lunar lunar = solar.getLunar();

            Assert.AreEqual("己亥", lunar.getYearInGanZhi(), "getYearInGanZhi 未返回所需的值。");
            Assert.AreEqual("己亥", lunar.getYearInGanZhiByLiChun(), "getYearInGanZhiByLiChun 未返回所需的值。");
            Assert.AreEqual("己亥", lunar.getYearInGanZhiExact(), "getYearInGanZhiExact 未返回所需的值。");

            Assert.AreEqual("丁丑", lunar.getMonthInGanZhi(), "getMonthInGanZhi 未返回所需的值。");
            Assert.AreEqual("丁丑", lunar.getMonthInGanZhiExact(), "getMonthInGanZhiExact 未返回所需的值。");
        }
Ejemplo n.º 2
0
        public void test19()
        {
            int year   = 1986;
            int month  = 5;
            int day    = 6;
            int hour   = 23;
            int minute = 22;
            int second = 0;

            Solar solar = new Solar(year, month, day, hour, minute, second);
            Lunar lunar = solar.getLunar();

            Assert.AreEqual("丙寅", lunar.getYearInGanZhi(), "getYearInGanZhi 未返回所需的值。");
            Assert.AreEqual("丙寅", lunar.getYearInGanZhiByLiChun(), "getYearInGanZhiByLiChun 未返回所需的值。");
            Assert.AreEqual("丙寅", lunar.getYearInGanZhiExact(), "getYearInGanZhiExact 未返回所需的值。");

            Assert.AreEqual("癸巳", lunar.getMonthInGanZhi(), "getMonthInGanZhi 未返回所需的值。");
            Assert.AreEqual("癸巳", lunar.getMonthInGanZhiExact(), "getMonthInGanZhiExact 未返回所需的值。");
        }