Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Jul 3, 2024
1 parent ac348c6 commit 04de349
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

namespace Speckle.Converters.Revit2023.Tests;

public class ModelCurveArrayToSpeckleConverterTests: MoqTest
public class ModelCurveArrayToSpeckleConverterTests : MoqTest
{
[Test]
public void Convert_Empty()
{
var revitConversionContextStack = Create<IRevitConversionContextStack>();
var scalingServiceToSpeckle = Create<IScalingServiceToSpeckle>();
var curveConverter = Create<ITypedConverter<DB.Curve, ICurve>>();

var sut = new ModelCurveArrayToSpeckleConverter(
revitConversionContextStack.Object,
scalingServiceToSpeckle.Object,
Expand Down Expand Up @@ -51,13 +51,13 @@ public void Convert()
geometry2.Setup(x => x.GetEndPoint(1)).Returns(endpoint2.Object);

var context = Create<IConversionContext<DB.Document>>();
revitConversionContextStack.Setup(x => x.Current).Returns(context.Object);
revitConversionContextStack.Setup(x => x.Current).Returns(context.Object);

var units = "units";
context.Setup(x => x.SpeckleUnits).Returns(units);

var scaleLength = 2.2;
scalingServiceToSpeckle.Setup(x => x.ScaleLength(2 + 3)).Returns(scaleLength);
scalingServiceToSpeckle.Setup(x => x.ScaleLength(2 + 3)).Returns(scaleLength);

endpoint1.Setup(x => x.DistanceTo(endpoint2.Object)).Returns(4.4);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public void Convert_ShouldConvertArcCorrectly()
var mockContextStack = Create<IConversionContextStack<RhinoDoc, UnitSystem>>();
var factory = Create<IBoxFactory>();


var context = Create<IConversionContext<RhinoDoc>>();
context.Setup(x => x.SpeckleUnits).Returns("units");
mockContextStack.Setup(cs => cs.Current).Returns(context.Object);
Expand All @@ -44,7 +43,7 @@ public void Convert_ShouldConvertArcCorrectly()
targetArc.Setup(x => x.EndPoint).Returns(point3d.Object);
targetArc.Setup(x => x.BoundingBox()).Returns(boundbox.Object);
factory.Setup(x => x.Create(boundbox.Object)).Returns(targetBox.Object);

mockPlaneConverter.Setup(pc => pc.Convert(targetPlane.Object)).Returns(new SOG.Plane());
mockPointConverter.Setup(pc => pc.Convert(It.IsAny<RG.Point3d>())).Returns(new SOG.Point());
mockBoxConverter.Setup(bc => bc.Convert(targetBox.Object)).Returns(new SOG.Box());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

namespace Speckle.Converters.Rhino7.Tests;

public class EllipseToSpeckleConverterTests: MoqTest
public class EllipseToSpeckleConverterTests : MoqTest
{

[Test]
public void Convert_Test()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public ArcToSpeckleConverter(
ITypedConverter<RG.Point3d, SOG.Point> pointConverter,
ITypedConverter<RG.Plane, SOG.Plane> planeConverter,
ITypedConverter<RG.Box, SOG.Box> boxConverter,
IConversionContextStack<RhinoDoc, UnitSystem> contextStack, IBoxFactory boxFactory)
IConversionContextStack<RhinoDoc, UnitSystem> contextStack,
IBoxFactory boxFactory
)
{
_pointConverter = pointConverter;
_planeConverter = planeConverter;
Expand Down
6 changes: 3 additions & 3 deletions DUI3-DX/Sdk/Speckle.Testing/MoqTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace Speckle.Testing;

public abstract class MoqTest
{

[SetUp]
public void Setup() => Repository = new(MockBehavior.Strict);

[TearDown]
public void Verify() => Repository.VerifyAll();

protected MockRepository Repository { get; private set; } =new(MockBehavior.Strict);
protected MockRepository Repository { get; private set; } = new(MockBehavior.Strict);

protected Mock<T> Create<T>() where T : class => Repository.Create<T>();
protected Mock<T> Create<T>()
where T : class => Repository.Create<T>();
}

0 comments on commit 04de349

Please sign in to comment.