Skip to content

Commit

Permalink
refactor: moved test class to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
psarras committed Dec 18, 2024
1 parent ec4b25a commit 6d60b0f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
28 changes: 0 additions & 28 deletions GsaGHTests/3_Components/0_Model/CreateGridLineTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,32 +235,4 @@ private static void SelectMetersInDropdown(GH_OasysDropDownComponent component)
component.SetSelected(0, 2);
}
}

[Collection("GrasshopperFixture collection")]
public class GsaGridLineTests {

[Fact]
public void ShouldCalculateAngleBetweenXAxisAndLine() {
var line = new Line(Point3d.Origin, new Point3d(1, 1, 0));
var gsaGridLine = new GsaGridLine(line, string.Empty);

Assert.Equal(45, gsaGridLine.GridLine.Theta1, precision: 5);
}

[Fact]
public void ShouldProvideTheClockwiseAngle() {
var line = new Line(Point3d.Origin, new Point3d(1, -1, 0));
var gsaGridLine = new GsaGridLine(line, string.Empty);

Assert.Equal(315, gsaGridLine.GridLine.Theta1, precision: 5);
}
[Fact]
public void ShouldProvideTheClockwiseAngle2() {
var line = new Line(Point3d.Origin, new Point3d(-1, -1, 0));
var gsaGridLine = new GsaGridLine(line, string.Empty);

Assert.Equal(225, gsaGridLine.GridLine.Theta1, precision: 5);
}

}
}
36 changes: 36 additions & 0 deletions GsaGHTests/3_Components/0_Model/GsaGridLineTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using GsaGH.Parameters;

using Rhino.Geometry;

using Xunit;

namespace GsaGHTests.Model {
[Collection("GrasshopperFixture collection")]
public class GsaGridLineTests {

[Fact]
public void ShouldCalculateAngleBetweenXAxisAndLine() {
var line = new Line(Point3d.Origin, new Point3d(1, 1, 0));
var gsaGridLine = new GsaGridLine(line, string.Empty);

Assert.Equal(45, gsaGridLine.GridLine.Theta1, precision: 5);
}

[Fact]
public void ShouldProvideTheClockwiseAngle() {
var line = new Line(Point3d.Origin, new Point3d(1, -1, 0));
var gsaGridLine = new GsaGridLine(line, string.Empty);

Assert.Equal(315, gsaGridLine.GridLine.Theta1, precision: 5);
}

[Fact]
public void ShouldProvideTheClockwiseAngle2() {
var line = new Line(Point3d.Origin, new Point3d(-1, -1, 0));
var gsaGridLine = new GsaGridLine(line, string.Empty);

Assert.Equal(225, gsaGridLine.GridLine.Theta1, precision: 5);
}

}
}

0 comments on commit 6d60b0f

Please sign in to comment.