本文整理汇总了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));
}
}
示例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));
}
}
示例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);
}
}
示例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));
}
}
示例5: TestGetPlanetName_Asteroid
public void TestGetPlanetName_Asteroid()
{
using (var swe = new SwissEph()) {
Assert.AreEqual("10000", swe.swe_get_planet_name(SwissEph.SE_AST_OFFSET));
}
}