Skip to content

Commit

Permalink
Reset test to original
Browse files Browse the repository at this point in the history
  • Loading branch information
serenayl committed Jul 17, 2024
1 parent 4a9108c commit 71758cf
Showing 1 changed file with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

using Elements;
using Xunit;
using System;
using System.IO;
using System.Collections.Generic;
using Elements.Serialization.glTF;
Expand All @@ -17,26 +16,36 @@ public class PrivateOfficeLayoutTest
[Fact]
public void TestExecute()
{
// GltfExtensions.GltfCachePath = "/Users/andrewheumann/Desktop/Test-disk-cache";
var input = GetInput();

var modelDependencies = new Dictionary<string, Model> {
{"Space Planning Zones", Model.FromJson(File.ReadAllText(@"/Users/serenali/Github/hypar/HyparSpace/LayoutFunctions/PrivateOfficeLayout/test/Generated/PrivateOfficeLayoutTest/model_dependencies/Space Planning Zones/3fe9633f-9409-4de0-a268-a3dcc99d440e.json")) },
{"Levels", Model.FromJson(File.ReadAllText(@"/Users/serenali/Github/hypar/HyparSpace/LayoutFunctions/PrivateOfficeLayout/test/Generated/PrivateOfficeLayoutTest/model_dependencies/Levels/dbb4a7cf-94ec-4fcd-b54b-9b18be256cea.json")) },
{"Program Requirements", Model.FromJson(File.ReadAllText(@"/Users/serenali/Github/hypar/HyparSpace/LayoutFunctions/PrivateOfficeLayout/test/Generated/PrivateOfficeLayoutTest/model_dependencies/Program Requirements/339f85c3-4d88-407a-aa37-501a8e360100.json")) },
{"Conceptual Mass", Model.FromJson(File.ReadAllText(@"/Users/serenali/Github/hypar/HyparSpace/LayoutFunctions/PrivateOfficeLayout/test/Generated/PrivateOfficeLayoutTest/model_dependencies/Conceptual Mass/7b2f1733-da76-45db-9d72-ff577d13eaf6.json")) },
var modelDependencies = new Dictionary<string, Model> {
{"Levels", Model.FromJson(File.ReadAllText(@"/Users/andrewheumann/Dev/HyparSpace/LayoutFunctions/PrivateOfficeLayout/test/Generated/PrivateOfficeLayoutTest/model_dependencies/Levels/09fa5ad7-f5e4-43a0-9e48-31319a4f59ec.json")) },
{"Space Planning Zones", Model.FromJson(File.ReadAllText(@"/Users/andrewheumann/Dev/HyparSpace/LayoutFunctions/PrivateOfficeLayout/test/Generated/PrivateOfficeLayoutTest/model_dependencies/Space Planning Zones/2475065a-1007-4aea-bf59-5e3807f92e1c.json")) },
};

var result = PrivateOfficeLayout.Execute(modelDependencies, input);
result.Model.ToGlTF("../../../Generated/PrivateOfficeLayoutTest/results/PrivateOfficeLayoutTest.gltf", false);
// result.Model.ToGlTF("../../../Generated/PrivateOfficeLayoutTest/results/PrivateOfficeLayoutTest.gltf", false);
result.Model.ToGlTF("../../../Generated/PrivateOfficeLayoutTest/results/PrivateOfficeLayoutTest.glb");
File.WriteAllText("../../../Generated/PrivateOfficeLayoutTest/results/PrivateOfficeLayoutTest.json", result.Model.ToJson());

}

public PrivateOfficeLayoutInputs GetInput()
{
var json = File.ReadAllText("../../../Generated/PrivateOfficeLayoutTest/inputs.json");
return Newtonsoft.Json.JsonConvert.DeserializeObject<PrivateOfficeLayoutInputs>(json);
var inputText = @"
{
""model_input_keys"": {
""Levels"": ""09fa5ad7-f5e4-43a0-9e48-31319a4f59ec_61dbb9f8-aaae-4295-9112-c8ae81655361_elements.zip"",
""Space Planning Zones"": ""2475065a-1007-4aea-bf59-5e3807f92e1c_09b8407f-6c93-4741-ad6c-31288213f4f7_elements.zip""
},
""Create Walls"": true,
""Office Sizing"": {
""Automate Office Subdivisions"": false,
""Office Size"": 3.047999902464003
}
}
";
return Newtonsoft.Json.JsonConvert.DeserializeObject<PrivateOfficeLayoutInputs>(inputText);
}
}
}

0 comments on commit 71758cf

Please sign in to comment.