コード例 #1
0
        public void testSolar2JD()
        {
            double expected = 2459045.5;
            double actual;

            actual = Solar.fromYmd(2020, 7, 15).getJulianDay();

            Assert.AreEqual(expected, actual, "Lunar.Solar.getJulianDay 未返回所需的值。");
        }
コード例 #2
0
        public void testNext()
        {
            Solar solar = Solar.fromYmd(2020, 11, 26);

            Assert.AreEqual("感恩节", solar.getFestivals()[0]);

            solar = Solar.fromYmd(2020, 6, 21);
            Assert.AreEqual("父亲节", solar.getFestivals()[0]);

            solar = Solar.fromYmd(2021, 5, 9);
            Assert.AreEqual("母亲节", solar.getFestivals()[0]);

            solar = Solar.fromYmd(1986, 11, 27);
            Assert.AreEqual("感恩节", solar.getFestivals()[0]);

            solar = Solar.fromYmd(1985, 6, 16);
            Assert.AreEqual("父亲节", solar.getFestivals()[0]);

            solar = Solar.fromYmd(1984, 5, 13);
            Assert.AreEqual("母亲节", solar.getFestivals()[0]);
        }