-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using GsaGH.Parameters; | ||
|
||
using Rhino.Geometry; | ||
|
||
using Xunit; | ||
|
||
namespace GsaGHTests.Model { | ||
[Collection("GrasshopperFixture collection")] | ||
public class GsaGridLineTests { | ||
|
||
[Fact] | ||
public void ShouldReturnZeroForParallelLine() { | ||
var line = new Line(Point3d.Origin, new Point3d(1, 0, 0)); | ||
var gsaGridLine = new GsaGridLine(line, string.Empty); | ||
|
||
Assert.Equal(0, gsaGridLine.GridLine.Theta1, precision: 5); | ||
} | ||
|
||
[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); | ||
} | ||
|
||
} | ||
} |