cleanup ProgramConfig Load

This commit is contained in:
Tyrel Souza 2022-07-26 00:27:58 -04:00
parent da412f2cc5
commit e071fdb09c
2 changed files with 10 additions and 4 deletions

View File

@ -47,11 +47,13 @@ namespace BenchtopParser {
if (data.StartsWith("=")) { continue; /* comment line */ }
var lineConfig = new Configuration();
lineConfig.unit = configLine[1];
lineConfig.type = configLine[2]; //a, c, f, i
var nameValue = data.Split("=");
lineConfig.name = nameValue[0];
lineConfig.value = nameValue[1];
lineConfig.unit = configLine[1].Trim();
lineConfig.type = configLine[2].Trim(); //a, c, f, i
lineConfig.name = nameValue[0].Trim();
lineConfig.value = nameValue[1].Trim();
// Deal with this group logic
var group = programnumber_group_data[1];

View File

@ -15,6 +15,10 @@ namespace BenchtopParserTests {
// Check that group collecting works -
Assert.That(configs["P1"].Group["I"]["3"].value, Is.EqualTo("Unassigned"));
Assert.That(configs["P1"].Group["O"]["3"].value, Is.EqualTo("Test Passed"));
Assert.That(configs["P1"].Group["P"]["Minimum Pressure"].value, Is.EqualTo("95.000"));
Assert.That(configs["P1"].Group["P"]["Minimum Pressure"].unit, Is.EqualTo("mbar"));
Assert.That(configs["P1"].Group["P"]["Minimum Pressure"].type, Is.EqualTo("f"));
}
[Test]