-
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.
Fix grid point load not being in the right location
- Loading branch information
Kristjan Nielsen
committed
Oct 10, 2023
1 parent
831d016
commit cecce67
Showing
3 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
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
42 changes: 42 additions & 0 deletions
42
IntegrationTests/2_Parameters/3_Loads/GridPointLoadTests.cs
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,42 @@ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
using Grasshopper.Kernel; | ||
using Xunit; | ||
|
||
namespace IntegrationTests.Parameters { | ||
[Collection("GrasshopperFixture collection")] | ||
public class GridPointLoadTests { | ||
public static GH_Document Document => document ?? (document = OpenDocument()); | ||
private static GH_Document document = null; | ||
|
||
[Theory] | ||
[InlineData("LoadIsEqual", 0)] | ||
[InlineData("PointIsEqual", 0)] | ||
public void TestTxtInput(string groupIdentifier, object expected) { | ||
IGH_Param param = Helper.FindParameter(Document, groupIdentifier); | ||
Helper.TestGhPrimitives(param, expected); | ||
} | ||
|
||
private static GH_Document OpenDocument() { | ||
string fileName = MethodBase.GetCurrentMethod().DeclaringType + ".gh"; | ||
fileName = fileName.Replace("IntegrationTests.Parameters.", string.Empty) | ||
.Replace("Tests", string.Empty); | ||
|
||
string solutiondir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent | ||
.Parent.FullName; | ||
string path = Path.Combine(new string[] { | ||
solutiondir, | ||
"ExampleFiles", | ||
"Parameters", | ||
"3_Loads", | ||
}); | ||
var io = new GH_DocumentIO(); | ||
Assert.True(File.Exists(Path.Combine(path, fileName))); | ||
Assert.True(io.Open(Path.Combine(path, fileName))); | ||
io.Document.NewSolution(true); | ||
|
||
return io.Document; | ||
} | ||
} | ||
} |