@@ -70,12 +70,6 @@ public void CreateFromNaifObject()
7070 Assert . Equal ( Frames . Frame . ECLIPTIC_J2000 , moon . InitialOrbitalParameters . Frame ) ;
7171 }
7272
73- // [Fact]
74- // public void CreateExceptions()
75- // {
76- // Assert.Throws<InvalidOperationException>(() => new CelestialBody(-399));
77- // }
78-
7973 [ Fact ]
8074 public void FindOccultationsEclipse ( )
8175 {
@@ -109,22 +103,6 @@ public void FindWindowsOnDistanceConstraint()
109103 Assert . Equal ( new TimeSystem . Time ( "2000-03-30T07:01:07.2974489 TDB" ) , windows . ElementAt ( 3 ) . EndDate ) ;
110104 }
111105
112- // [Fact]
113- // public void FindWindowsOnCoordinateConstraint()
114- // {
115- // var res = TestHelpers.EarthAtJ2000.FindWindowsOnCoordinateConstraint(
116- // new Window(new TimeSystem.Time(DateTime.Parse("2005-10-03"), TimeFrame.TDBFrame), new TimeSystem.Time(DateTime.Parse("2005-11-03"), TimeFrame.TDBFrame)),
117- // TestHelpers.MoonAtJ2000, TestHelpers.MoonAtJ2000.Frame, CoordinateSystem.Latitudinal, Coordinate.Latitude, RelationnalOperator.Greater, 0.0, 0.0, Aberration.None,
118- // TimeSpan.FromSeconds(60.0));
119- //
120- // var windows = res as Window[] ?? res.ToArray();
121- // Assert.Equal(2, windows.Length);
122- // Assert.Equal("2005-10-03T17:24:29.0992341 TDB", windows[0].StartDate.ToString());
123- // Assert.Equal("2005-10-16T17:50:20.7049530 TDB", windows[0].EndDate.ToString());
124- // Assert.Equal("2005-10-31T00:27:02.6705884 TDB", windows[1].StartDate.ToString());
125- // Assert.Equal("2005-11-03T00:00:00.0000000 TDB", windows[1].EndDate.ToString());
126- // }
127-
128106 [ Fact ]
129107 public void AngularSize ( )
130108 {
@@ -527,4 +505,32 @@ public void FindCenterOfMotionId_ReturnsTen_ForLagrangePoint394()
527505 var celestialItem = new LagrangePoint ( LagrangePoints . L4 ) ;
528506 Assert . Equal ( 10 , celestialItem . CenterOfMotionId ) ;
529507 }
508+
509+ [ Fact ]
510+ public void Create_ReturnsBarycenter_ForNaifIdLessThan10 ( )
511+ {
512+ var result = CelestialItem . Create ( 5 ) ;
513+ Assert . IsType < Barycenter > ( result ) ;
514+ }
515+
516+ [ Fact ]
517+ public void Create_ReturnsLagrangePoint_ForNaifIdBetweenL1AndL5 ( )
518+ {
519+ var result = CelestialItem . Create ( 391 ) ;
520+ Assert . IsType < LagrangePoint > ( result ) ;
521+ }
522+
523+ [ Fact ]
524+ public void Create_ReturnsCelestialBody_ForNaifIdGreaterThan10AndNotLagrangePoint ( )
525+ {
526+ var result = CelestialItem . Create ( 199 ) ;
527+ Assert . IsType < CelestialBody > ( result ) ;
528+ }
529+
530+ [ Fact ]
531+ public void Create_ReturnsLagrangePoint_WithCorrectName ( )
532+ {
533+ var result = ( LagrangePoint ) CelestialItem . Create ( 392 ) ;
534+ Assert . Equal ( "L2" , result . Name ) ;
535+ }
530536}
0 commit comments