当前位置: 首页>>代码示例>>C#>>正文


C# SwissEph.swe_get_planet_name方法代码示例

本文整理汇总了C#中SwissEph.swe_get_planet_name方法的典型用法代码示例。如果您正苦于以下问题:C# SwissEph.swe_get_planet_name方法的具体用法?C# SwissEph.swe_get_planet_name怎么用?C# SwissEph.swe_get_planet_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SwissEph的用法示例。


在下文中一共展示了SwissEph.swe_get_planet_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test_swe_get_planet_name_Fictitious

 public void Test_swe_get_planet_name_Fictitious()
 {
     using (var swe = new SwissEph()) {
         Assert.AreEqual("Cupido", swe.swe_get_planet_name(SwissEph.SE_FICT_OFFSET));
         Assert.AreEqual("name not found", swe.swe_get_planet_name(SwissEph.SE_FICT_MAX));
     }
 }
开发者ID:thenuts,项目名称:SwissEphNet,代码行数:7,代码来源:SwissEphTest.Planets.cs

示例2: TestOnLoadFile

        public void TestOnLoadFile()
        {
            // No file loading defined
            using (var target = new SwissEph()) {
                Assert.AreEqual("100: not found", target.swe_get_planet_name(SwissEph.SE_AST_OFFSET + 100));
            }

            // File loading defined, but file not found
            using (var target = new SwissEph()) {
                target.OnLoadFile += (s, e) => {
                    e.File = null;
                };
                Assert.AreEqual("100: not found", target.swe_get_planet_name(SwissEph.SE_AST_OFFSET + 100));
            }

            // File loading defined
            using (var target = new SwissEph()) {
                target.OnLoadFile += (s, e) => {
                    if (e.FileName == @"[ephe]\seasnam.txt") {
                        e.File = new System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes(@"
            000096  Aegle
            000097  Klotho
            000098  Ianthe
            000099  Dike
            000100  Hekate
            000101  Helena
            000102  Miriam
            000103  Hera
            "));
                    } else
                        e.File = null;
                };
                Assert.AreEqual("Hekate", target.swe_get_planet_name(SwissEph.SE_AST_OFFSET + 100));
            }
        }
开发者ID:PinoEire,项目名称:SwissEphNet,代码行数:35,代码来源:SwissEphTest.cs

示例3: Test_swe_get_planet_name_Trace

        public void Test_swe_get_planet_name_Trace()
        {
            using (var swe = new SwissEph()) {
                List<String> trace_out = new List<string>();
                swe.OnTrace += (s, e) => {
                    trace_out.Add(e.Message);
                };
                Assert.AreEqual("Sun", swe.swe_get_planet_name(SwissEph.SE_SUN));

                CollectionAssert.AreEqual(new String[] {
                    "swe_get_planet_name: 0\tSun\t"
                }, trace_out);
            }
        }
开发者ID:thenuts,项目名称:SwissEphNet,代码行数:14,代码来源:SwissEphTest.Planets.cs

示例4: Test_swe_get_planet_name

        public void Test_swe_get_planet_name()
        {
            using (var swe = new SwissEph()) {
                Assert.AreEqual("Sun", swe.swe_get_planet_name(SwissEph.SE_SUN));
                Assert.AreEqual("Moon", swe.swe_get_planet_name(SwissEph.SE_MOON));
                Assert.AreEqual("Mercury", swe.swe_get_planet_name(SwissEph.SE_MERCURY));
                Assert.AreEqual("Venus", swe.swe_get_planet_name(SwissEph.SE_VENUS));
                Assert.AreEqual("Earth", swe.swe_get_planet_name(SwissEph.SE_EARTH));
                Assert.AreEqual("Mars", swe.swe_get_planet_name(SwissEph.SE_MARS));
                Assert.AreEqual("Jupiter", swe.swe_get_planet_name(SwissEph.SE_JUPITER));
                Assert.AreEqual("Saturn", swe.swe_get_planet_name(SwissEph.SE_SATURN));
                Assert.AreEqual("Uranus", swe.swe_get_planet_name(SwissEph.SE_URANUS));
                Assert.AreEqual("Neptune", swe.swe_get_planet_name(SwissEph.SE_NEPTUNE));

                Assert.AreEqual("Pluto", swe.swe_get_planet_name(SwissEph.SE_PLUTO));
                Assert.AreEqual("mean Node", swe.swe_get_planet_name(SwissEph.SE_MEAN_NODE));
                Assert.AreEqual("true Node", swe.swe_get_planet_name(SwissEph.SE_TRUE_NODE));
                Assert.AreEqual("mean Apogee", swe.swe_get_planet_name(SwissEph.SE_MEAN_APOG));
                Assert.AreEqual("osc. Apogee", swe.swe_get_planet_name(SwissEph.SE_OSCU_APOG));
                Assert.AreEqual("Chiron", swe.swe_get_planet_name(SwissEph.SE_CHIRON));
                Assert.AreEqual("Pholus", swe.swe_get_planet_name(SwissEph.SE_PHOLUS));
                Assert.AreEqual("Ceres", swe.swe_get_planet_name(SwissEph.SE_CERES));
                Assert.AreEqual("Pallas", swe.swe_get_planet_name(SwissEph.SE_PALLAS));
                Assert.AreEqual("Juno", swe.swe_get_planet_name(SwissEph.SE_JUNO));
                Assert.AreEqual("Vesta", swe.swe_get_planet_name(SwissEph.SE_VESTA));
                Assert.AreEqual("intp. Apogee", swe.swe_get_planet_name(SwissEph.SE_INTP_APOG));
                Assert.AreEqual("intp. Perigee", swe.swe_get_planet_name(SwissEph.SE_INTP_PERG));

                Assert.AreEqual("Pluto", swe.swe_get_planet_name(SwissEph.SE_AST_OFFSET + 134340));

                // Call twice the same planet for code coverage in swe_get_planet_name optimization planet name
                Assert.AreEqual("Pluto", swe.swe_get_planet_name(SwissEph.SE_PLUTO));
                Assert.AreEqual("Pluto", swe.swe_get_planet_name(SwissEph.SE_PLUTO));
            }
        }
开发者ID:thenuts,项目名称:SwissEphNet,代码行数:35,代码来源:SwissEphTest.Planets.cs

示例5: TestGetPlanetName_Asteroid

 public void TestGetPlanetName_Asteroid()
 {
     using (var swe = new SwissEph()) {
         Assert.AreEqual("10000", swe.swe_get_planet_name(SwissEph.SE_AST_OFFSET));
     }
 }
开发者ID:thenuts,项目名称:SwissEphNet,代码行数:6,代码来源:SwissEphTest.Planets.cs


注:本文中的SwissEph.swe_get_planet_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。