mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-11 21:48:34 +00:00
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
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"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Cylinder_UncenteredPositionZValueIsHalfTheHeight()
|
|
{
|
|
var cylinder = new Cylinder(3, 40);
|
|
|
|
Assert.AreEqual(new Vector3(0, 0, 20), cylinder.Position());
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Cylinder_CenteredCylinderPositionIsZero()
|
|
{
|
|
var cylinder = new Cylinder(5, 20, true);
|
|
|
|
Assert.AreEqual(new Vector3(), cylinder.Position());
|
|
}
|
|
}
|
|
}
|