mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-11 21:48:34 +00:00
Fix for missing Diameter value assignment in Cylinder constructor
This commit is contained in:
parent
750937a25e
commit
1402690f2d
27
OSCADSharp/OSCADSharp.UnitTests/CylinderTests.cs
Normal file
27
OSCADSharp/OSCADSharp.UnitTests/CylinderTests.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OSCADSharp.Solids;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OSCADSharp.UnitTests
|
||||
{
|
||||
[TestClass]
|
||||
public class CylinderTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void Cylinder_ConstructorParametersAffectScriptOutput()
|
||||
{
|
||||
var cylinder = new Cylinder(5.5, 12.1, true);
|
||||
|
||||
string script = cylinder.ToString();
|
||||
|
||||
Assert.IsTrue(script.Contains("r1 = 2.75"));
|
||||
Assert.IsTrue(script.Contains("r2 = 2.75"));
|
||||
Assert.IsTrue(script.Contains("h = 12.1"));
|
||||
Assert.IsTrue(script.Contains("center = true"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -53,6 +53,7 @@
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="CubeTests.cs" />
|
||||
<Compile Include="CylinderTests.cs" />
|
||||
<Compile Include="OSCADObjectTests.cs" />
|
||||
<Compile Include="SphereTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
@ -111,6 +111,7 @@ namespace OSCADSharp.Solids
|
||||
public Cylinder(double diameter = 2, double height = 1, bool center = false)
|
||||
{
|
||||
this.Diameter = diameter;
|
||||
this.Height = height;
|
||||
this.Center = center;
|
||||
}
|
||||
#endregion
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user