コード例 #1
0
        public void Test_swe_cs2timestr() {
            using (var target = new SwissEph()) {
                Assert.Equal("00-00-00", target.swe_cs2timestr(0, '-', false));
                Assert.Equal("00-00", target.swe_cs2timestr(0, '-', true));
                Assert.Equal("00:00:00", target.swe_cs2timestr(0, ':', false));
                Assert.Equal("00:00", target.swe_cs2timestr(0, ':', true));

                Assert.Equal("03:25:46", target.swe_cs2timestr(1234567, ':', false));
                Assert.Equal("03:25:46", target.swe_cs2timestr(1234567, ':', true));

                Assert.Equal("0-:.+:,+", target.swe_cs2timestr(-1234567, ':', false));
                Assert.Equal("0-:.+:,+", target.swe_cs2timestr(-1234567, ':', true));
            }
        }
コード例 #2
0
ファイル: SwissEphTest.cs プロジェクト: PinoEire/SwissEphNet
        public void Test_swe_cs2timestr()
        {
            using (var target = new SwissEph()) {
                Assert.AreEqual("00-00-00", target.swe_cs2timestr(0, '-', false));
                Assert.AreEqual("00-00", target.swe_cs2timestr(0, '-', true));
                Assert.AreEqual("00:00:00", target.swe_cs2timestr(0, ':', false));
                Assert.AreEqual("00:00", target.swe_cs2timestr(0, ':', true));

                Assert.AreEqual("03:25:46", target.swe_cs2timestr(1234567, ':', false));
                Assert.AreEqual("03:25:46", target.swe_cs2timestr(1234567, ':', true));

                Assert.AreEqual("0-:.+:,+", target.swe_cs2timestr(-1234567, ':', false));
                Assert.AreEqual("0-:.+:,+", target.swe_cs2timestr(-1234567, ':', true));
            }
        }