diff --git a/DEHPCommon.Tests/Services/ExchangeHistoryServiceTestFixture.cs b/DEHPCommon.Tests/Services/ExchangeHistoryServiceTestFixture.cs index 50ce570..8d7dc23 100644 --- a/DEHPCommon.Tests/Services/ExchangeHistoryServiceTestFixture.cs +++ b/DEHPCommon.Tests/Services/ExchangeHistoryServiceTestFixture.cs @@ -232,5 +232,37 @@ public void VerifyClear() this.service.ClearPending(); Assert.IsEmpty(this.service.PendingEntries); } + + [Test] + public void VerifyAppendWithMultipleValuesValueSets() + { + var values = new List() { "-", "-", "-" }; + + var valueSet = new ParameterValueSet() + { + Computed = new ValueArray(values) + }; + + var valueSetClone = valueSet.Clone(false); + + var compoundParameterType = new CompoundParameterType() + { + Name = "testParameterType", + ShortName = "testParameterType", + Component = + { + new ParameterTypeComponent() { ParameterType = new DateParameterType() { Name = "date" } }, + new ParameterTypeComponent() { ParameterType = new TextParameterType() { Name = "text" } }, + new ParameterTypeComponent() { ParameterType = new SimpleQuantityKind() { Name = "number" } } + } + }; + + var parameter = new Parameter() { ParameterType = compoundParameterType, ValueSet = { valueSet }}; + this.element.Parameter.Add(parameter); + + Assert.DoesNotThrow(() => this.service.Append(valueSet, valueSetClone)); + + Assert.IsTrue(this.service.PendingEntries.LastOrDefault()?.Message.Contains(compoundParameterType.Name)); + } } } diff --git a/DEHPCommon.Tests/UserInterfaces/ViewModels/ObjectBrowserViewModelTestFixture.cs b/DEHPCommon.Tests/UserInterfaces/ViewModels/ObjectBrowserViewModelTestFixture.cs index d86e7fa..ab13f2a 100644 --- a/DEHPCommon.Tests/UserInterfaces/ViewModels/ObjectBrowserViewModelTestFixture.cs +++ b/DEHPCommon.Tests/UserInterfaces/ViewModels/ObjectBrowserViewModelTestFixture.cs @@ -155,6 +155,7 @@ public void VerifyTreesGetBuilt() this.viewModel.BuildTrees(iterationClone); Assert.IsNotEmpty(this.viewModel.Things); Assert.AreEqual(1, this.viewModel.Things.Count);Assert.IsEmpty(this.viewModel.Things.First().ContainedRows); + Assert.IsTrue(this.viewModel.Things.FirstOrDefault()?.IsExpanded); } [Test] diff --git a/DEHPCommon/Services/ExchangeHistory/ExchangeHistoryService.cs b/DEHPCommon/Services/ExchangeHistory/ExchangeHistoryService.cs index 6aeded1..f6584ee 100644 --- a/DEHPCommon/Services/ExchangeHistory/ExchangeHistoryService.cs +++ b/DEHPCommon/Services/ExchangeHistory/ExchangeHistoryService.cs @@ -107,9 +107,9 @@ public void Append(ParameterValueSetBase valueToUpdate, IValueSet newValue) var newValueString = $"{prefix} {newValueRepresentation} [{scale}]"; var valueToUpdateString = $"{prefix} {oldValueRepresentation} [{scale}]"; - + this.Append($"Value: [{valueToUpdateString}] from Parameter [{parameter?.ModelCode()}] " + - $"has been updated to [{newValueString}]"); + $"has been updated to [{newValueString}]"); } /// @@ -180,8 +180,8 @@ private static string GetValueSetValueRepresentation(ParameterBase parameter, IV var cols = parameter.ParameterType.NumberOfValues; return $"[{valueSet.Computed.Count / cols}x{cols}]"; } - - return valueSet.Computed[0] ?? "-"; + + return valueSet.Computed.DefaultIfEmpty("-").Aggregate((x, y) => $"{x},{y}"); } /// diff --git a/DEHPCommon/UserInterfaces/ViewModels/ObjectBrowserBaseViewModel.cs b/DEHPCommon/UserInterfaces/ViewModels/ObjectBrowserBaseViewModel.cs index dde87b1..14e685d 100644 --- a/DEHPCommon/UserInterfaces/ViewModels/ObjectBrowserBaseViewModel.cs +++ b/DEHPCommon/UserInterfaces/ViewModels/ObjectBrowserBaseViewModel.cs @@ -189,6 +189,11 @@ public virtual void BuildTrees(Iteration iteration = null) this.Things.Add(new ElementDefinitionsBrowserViewModel(iteration ?? this.HubController.OpenIteration, this.HubController.Session)); } } + + if (this.Things.FirstOrDefault() is { } firstNode) + { + firstNode.IsExpanded = true; + } } ///