PSTestConfigurationSetResult.cs (1777B)
1 // ----------------------------------------------------------------------------- 2 // <copyright file="PSTestConfigurationSetResult.cs" company="Microsoft Corporation"> 3 // Copyright (c) Microsoft Corporation. Licensed under the MIT License. 4 // </copyright> 5 // ----------------------------------------------------------------------------- 6 7 namespace Microsoft.WinGet.Configuration.Engine.PSObjects 8 { 9 using System.Collections.Generic; 10 using Microsoft.Management.Configuration; 11 using Microsoft.WinGet.Configuration.Engine.Helpers; 12 13 /// <summary> 14 /// Wrapper for TestConfigurationSetResult. 15 /// </summary> 16 public class PSTestConfigurationSetResult 17 { 18 /// <summary> 19 /// Initializes a new instance of the <see cref="PSTestConfigurationSetResult"/> class. 20 /// </summary> 21 /// <param name="testSetResult">Test set result.</param> 22 internal PSTestConfigurationSetResult(TestConfigurationSetResult testSetResult) 23 { 24 this.TestResult = Utilities.ToPSConfigurationTestResult(testSetResult.TestResult); 25 26 var unitResults = new List<PSTestConfigurationUnitResult>(); 27 foreach (var unitResult in testSetResult.UnitResults) 28 { 29 unitResults.Add(new PSTestConfigurationUnitResult(unitResult)); 30 } 31 32 this.UnitResults = unitResults; 33 } 34 35 /// <summary> 36 /// Gets the test result. 37 /// </summary> 38 public PSConfigurationTestResult TestResult { get; private init; } 39 40 /// <summary> 41 /// Gets the results of the units. 42 /// </summary> 43 public IReadOnlyList<PSTestConfigurationUnitResult> UnitResults { get; private init; } 44 } 45 }