From d80e2c036ac0b6b2ed4ff673d3398a9f82bf56c3 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 29 Feb 2016 18:43:35 -0800 Subject: [PATCH] + Added bindings for the remainder of Sphere's properties + Tests for Sphere properties --- .../OSCADSharp.UnitTests/Solids/SphereTests.cs | 18 ++++++++++++++++++ OSCADSharp/OSCADSharp/Solids/Sphere.cs | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/OSCADSharp/OSCADSharp.UnitTests/Solids/SphereTests.cs b/OSCADSharp/OSCADSharp.UnitTests/Solids/SphereTests.cs index 77bcad2..f9f2d10 100644 --- a/OSCADSharp/OSCADSharp.UnitTests/Solids/SphereTests.cs +++ b/OSCADSharp/OSCADSharp.UnitTests/Solids/SphereTests.cs @@ -148,5 +148,23 @@ namespace OSCADSharp.UnitTests string script = sphere.ToString(); Assert.IsTrue(script.Contains("d = diam")); } + + [TestMethod] + public void Sphere_ResolutionAngleAndFragmentSizeTest() + { + var resolution = new Variable("resolution", 30); + var angle = new Variable("angle", 5); + var fragSize = new Variable("fragSize", 10); + + var sphere = new Sphere(); + sphere.Bind("Resolution", resolution); + sphere.Bind("MinimumAngle", angle); + sphere.Bind("MinimumFragmentSize", fragSize); + + string script = sphere.ToString(); + Assert.IsTrue(script.Contains("$fn = resolution")); + Assert.IsTrue(script.Contains("$fa = angle")); + Assert.IsTrue(script.Contains("$fs = fragSize")); + } } } diff --git a/OSCADSharp/OSCADSharp/Solids/Sphere.cs b/OSCADSharp/OSCADSharp/Solids/Sphere.cs index 6e254d1..c11c05f 100644 --- a/OSCADSharp/OSCADSharp/Solids/Sphere.cs +++ b/OSCADSharp/OSCADSharp/Solids/Sphere.cs @@ -134,7 +134,7 @@ namespace OSCADSharp.Solids { { "radius", "r" }, { "minimumangle", "$fa" }, - { "minimumFragmentsize", "$fs" }, + { "minimumfragmentsize", "$fs" }, { "resolution", "$fn" }, { "diameter", "d" } });