Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #27 from speckleworks/mat-steel
Browse files Browse the repository at this point in the history
Mat steel
  • Loading branch information
nic-burgers-arup authored Sep 4, 2020
2 parents 42c896e + d7dd5a4 commit bbac0a0
Show file tree
Hide file tree
Showing 21 changed files with 1,733 additions and 66 deletions.
11 changes: 11 additions & 0 deletions SpeckleStructuralGSA.Test/Base/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ namespace SpeckleStructuralGSA.Test
{
public abstract class TestBase
{
public static string[] savedJsonFileNames = new[] { "lfsaIEYkR.json", "NaJD7d5kq.json", "U7ntEJkzdZ.json", "UNg87ieJG.json" };
public static string expectedGwaPerIdsFileName = "TestGwaRecords.json";

public static string[] savedBlankRefsJsonFileNames = new[] { "P40rt5c8I.json" };
public static string expectedBlankRefsGwaPerIdsFileName = "BlankRefsGwaRecords.json";

public static string[] savedSharedLoadPlaneJsonFileNames = new[] { "nagwSLyPE.json" };
public static string expectedSharedLoadPlaneGwaPerIdsFileName = "SharedLoadPlaneGwaRefords.json";

public static string[] simpleDataJsonFileNames = new[] { "gMu-Xgpc.json" };

protected IComAuto comAuto;

protected GSAProxy gsaInterfacer;
Expand Down
11 changes: 2 additions & 9 deletions SpeckleStructuralGSA.Test/Other/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static string ReadFile(string testDataFileName, string directory)
byte[] buffer;
//Directory should have a trailing slash

var fileStream = new FileStream(directory + testDataFileName, FileMode.Open, FileAccess.Read);
var fileStream = new FileStream(Path.Combine(directory, testDataFileName), FileMode.Open, FileAccess.Read);
try
{
var length = (int)fileStream.Length; // get file length
Expand All @@ -121,13 +121,6 @@ public static string ReadFile(string testDataFileName, string directory)
return Encoding.UTF8.GetString(buffer);
}

public static string ResolveFullPath(string fileName, string directory)
{
//Directory should have a trailing slash

return (directory + fileName);
}

public static void WriteFile(string data, string fileName, string directory)
{
var stream = new MemoryStream();
Expand All @@ -138,7 +131,7 @@ public static void WriteFile(string data, string fileName, string directory)
stream.Position = 0;
stream.Seek(0, SeekOrigin.Begin);

var fileStream = File.Create(ResolveFullPath(fileName, directory));
var fileStream = File.Create(Path.Combine(directory, fileName));
stream.CopyTo(fileStream);
fileStream.Close();
}
Expand Down
10 changes: 0 additions & 10 deletions SpeckleStructuralGSA.Test/Other/SenderProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ public void GsaInstanceToSpeckleObjects(GSATargetLayer layer, out List<SpeckleOb
} while (currentBatch.Count > 0);

speckleObjects.AddRange(Initialiser.GSASenderObjects.GetAll().SelectMany(i => i.Value).Select(o => (SpeckleObject)((IGSASpeckleContainer)o).Value));

/*
foreach (var t in Initialiser.GSASenderObjects.Keys)
{
foreach (var o in Initialiser.GSASenderObjects[t])
{
speckleObjects.Add((SpeckleObject)(((IGSASpeckleContainer)o).Value));
}
}
*/
}

#region private_methods
Expand Down
13 changes: 7 additions & 6 deletions SpeckleStructuralGSA.Test/SpeckleStructuralGSA.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,18 @@
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="TestData\lfsaIEYkR.json" />
<None Include="TestData\nagwSLyPE.json" />
<None Include="TestData\NaJD7d5kq.json" />
<None Include="TestData\P40rt5c8I.json" />
<None Include="TestData\Simple\gMu-Xgpc.json" />
<None Include="TestData\NB\lfsaIEYkR.json" />
<None Include="TestData\ShareLoadPlane\nagwSLyPE.json" />
<None Include="TestData\NB\NaJD7d5kq.json" />
<None Include="TestData\Blank\P40rt5c8I.json" />
<None Include="TestData\TxSpeckleObjectsDesignLayer.json" />
<None Include="TestData\TxSpeckleObjectsDesignLayerBeforeAnalysis.json" />
<None Include="TestData\TxSpeckleObjectsEmbedded.json" />
<None Include="TestData\TxSpeckleObjectsNotEmbedded.json" />
<None Include="TestData\TxSpeckleObjectsResultsOnly.json" />
<None Include="TestData\U7ntEJkzdZ.json" />
<None Include="TestData\UNg87ieJG.json" />
<None Include="TestData\NB\U7ntEJkzdZ.json" />
<None Include="TestData\NB\UNg87ieJG.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SpeckleStructuralClasses\SpeckleStructuralClasses.csproj">
Expand Down
Loading

0 comments on commit bbac0a0

Please sign in to comment.