8a148b892f
* removes unused classes and gh schema constructors * additional cleanup of backwards compatibility (v2) * Update Arc.cs * updates unit tests * re-adds bbox to box * updates tests * pr fixes for backwards compatibility * Uses a new objects test in Revit for serialization tests * format * updates revit model curve class to inherit from curve geometry, and adds deprecated v2 classes * fixes transform unit tests * fixes deprecated speckle type * removes unnecessary new revit curve classes --------- Co-authored-by: Adam Hathcock <adam@hathcock.uk> Co-authored-by: Alan Rynne <alan@rynne.es>
41 lines
873 B
C#
41 lines
873 B
C#
using NUnit.Framework;
|
|
using Speckle.Objects.Geometry;
|
|
using Speckle.Sdk.Common;
|
|
|
|
namespace Speckle.Objects.Tests.Unit.Geometry;
|
|
|
|
[TestFixture, TestOf(typeof(Circle))]
|
|
public class CircleTests
|
|
{
|
|
private Plane TestPlane
|
|
{
|
|
get
|
|
{
|
|
const string UNITS = Units.Meters;
|
|
return new()
|
|
{
|
|
origin = new Point(0, 0, 0, UNITS),
|
|
normal = new Vector(0, 0, 1, UNITS),
|
|
xdir = new Vector(1, 0, 0, UNITS),
|
|
ydir = new Vector(0, 1, 0, UNITS),
|
|
units = UNITS,
|
|
};
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public void CanCreateCircle()
|
|
{
|
|
const string UNITS = Units.Meters;
|
|
var circle = new Circle()
|
|
{
|
|
plane = TestPlane,
|
|
radius = 5,
|
|
units = UNITS,
|
|
};
|
|
|
|
Assert.That(circle.length, Is.EqualTo(2 * Math.PI * 5).Within(0.0001));
|
|
Assert.That(circle.area, Is.EqualTo(Math.PI * 5 * 5).Within(0.0001));
|
|
}
|
|
}
|