public void ParseEmpty() { var sphere = new An8Sphere(); sphere.Parse( @" "); }
public void NewSphere() { var sphere = new An8Sphere(); Assert.Null(sphere.Material); Assert.Null(sphere.LongLatDivisions); Assert.False(sphere.Geodesic.HasValue); }
public void ParseOther() { var sphere = new An8Sphere(); sphere.Parse( @" other { } "); }
public void ParseMaterial() { var sphere = new An8Sphere(); sphere.Parse( @" material { } "); Assert.NotNull(sphere.Material); }
public void ParseGeodesic() { var sphere = new An8Sphere(); sphere.LongLatDivisions = new An8LongLat(); sphere.Parse( @" geodesic { 2 } "); Assert.Null(sphere.LongLatDivisions); Assert.True(sphere.Geodesic.HasValue); Assert.Equal(2, sphere.Geodesic.Value); }
public void ParseLongLatDivisions() { var sphere = new An8Sphere(); sphere.Geodesic = 0; sphere.Parse( @" longlat { 2 3 } "); Assert.Null(sphere.Geodesic); Assert.NotNull(sphere.LongLatDivisions); Assert.Equal(2, sphere.LongLatDivisions.VerticalDivisions); Assert.Equal(3, sphere.LongLatDivisions.HorizontalDivisions); }
public void GenerateTextEmpty() { var sphere = new An8Sphere(); var text = sphere.GenerateText(); string expected = @"sphere { name { """" } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }
public void GenerateTextLongLatDivisions() { var sphere = new An8Sphere(); sphere.LongLatDivisions = new An8LongLat { VerticalDivisions = 2, HorizontalDivisions = 3 }; var text = sphere.GenerateText(); string expected = @"sphere { name { """" } longlat { 2 3 } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }