Skip to content

Commit

Permalink
test(*): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed May 8, 2022
1 parent ef1e841 commit ac025fc
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 115 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
mv src/Ironbug.Grasshopper/bin/x64/Release/Ironbug.* installer/plugin
ls installer/plugin -r
- name: Unit tests
run: |
dotnet test src\Ironbug.HVAC_Tests /p:Platform=x64
- name: Install the InstalBuilder
shell: bash
Expand Down
17 changes: 12 additions & 5 deletions src/Ironbug.HVAC_Tests/00_DummyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,18 @@ public void CreateEMSTest()
//https://github.com/NREL/openstudio-standards/blob/master/lib/openstudio-standards/prototypes/common/objects/Prototype.CentralAirSourceHeatPump.rb

//var inPath = @"C:\Users\mingo\simulation\HB_Template\OpenStudio\run\in.osm";
var inPath = @"C:\Users\mingo\simulation\IB_EMS\OpenStudio\run\in_IB.osm";
var outPath = @"C:\Users\mingo\simulation\HB_Template\OpenStudio\run\in_EMS.osm";
//var inPath = @"C:\Users\mingo\simulation\IB_EMS\OpenStudio\run\in_IB.osm";
var outPath = @"EMS.osm";

var model = OpenStudio.Model.load(OpenStudioUtilitiesCore.toPath(inPath)).get();
var hot_water_loop = model.getPlantLoopByName("Hot Water Loop").get();
//var model = OpenStudio.Model.load(OpenStudioUtilitiesCore.toPath(inPath)).get();
var model = new OpenStudio.Model();
var hotWaterLoop = new OpenStudio.PlantLoop(model);
hotWaterLoop.setName("Hot Water Loop");

var userCom = new OpenStudio.PlantComponentUserDefined(model);
hotWaterLoop.addSupplyBranchForComponent(userCom);

//var hot_water_loop = model.getPlantLoopByName("Hot Water Loop").get();
//var model = new Model();

////remove old one
Expand Down Expand Up @@ -280,7 +287,7 @@ public void CreateEMSTest()



AddCentralAirSouceHeatPump(model, hot_water_loop);
AddCentralAirSouceHeatPump(model, hotWaterLoop);
//var plant_comp = model.getPlantComponentUserDefineds().First();
//var htg_op_scheme = new PlantEquipmentOperationHeatingLoad(model);
//htg_op_scheme.addEquipment(1000000000, plant_comp);
Expand Down
2 changes: 1 addition & 1 deletion src/Ironbug.HVAC_Tests/Loop/IB_ThermalZone_Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void OpenStudioDll_Test()
var m = new Model();
var v = m.version().str();
Console.WriteLine($"Loaded version: {v}");
Assert.IsTrue(v == "3.1.1");
Assert.IsTrue(v == "3.4.0");
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion src/Ironbug.HVAC_Tests/SerializationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void CheckAllObjectsConstructors_Test()
Assert.IsTrue(typesTobeFixed.Count == 0);
}

[Test]
//[Test]
public void Deserialize_Test()
{
var p = @"C:\Users\mingo\Desktop\New folder\IbJson.json";
Expand Down
3 changes: 2 additions & 1 deletion src/Ironbug.HVAC_Tests/TestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public static class TestHelper
{
public static string GenFileName => $"{System.Guid.NewGuid().ToString().Substring(0, 5)}.osm";

public static string Root => Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(typeof(TestHelper).Assembly.Location))));
private static string bin => Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(typeof(TestHelper).Assembly.Location))));
public static string Root => Path.GetDirectoryName(bin);
public static string TestSourceFolder = Path.Combine(Root, "TestSource");
public static string ExampleBuildingFile = Path.Combine(TestSourceFolder, "BuildingForTest.osm");

Expand Down
Loading

0 comments on commit ac025fc

Please sign in to comment.