Skip to content

Commit 53a2147

Browse files
committed
Implement test for source resource
1 parent de947df commit 53a2147

File tree

3 files changed

+490
-7
lines changed

3 files changed

+490
-7
lines changed

src/AppInstallerCLIE2ETests/DSCv3ResourceCommands.cs renamed to src/AppInstallerCLIE2ETests/DSCv3PackageResourceCommand.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// -----------------------------------------------------------------------------
2-
// <copyright file="DSCv3ResourceCommands.cs" company="Microsoft Corporation">
2+
// <copyright file="DSCv3PackageResourceCommand.cs" company="Microsoft Corporation">
33
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
44
// </copyright>
55
// -----------------------------------------------------------------------------
@@ -16,7 +16,7 @@ namespace AppInstallerCLIE2ETests
1616
/// </summary>
1717
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3687 pending SC 1.2 release")]
1818
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1011:Closing square brackets should be spaced correctly", Justification = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3687 pending SC 1.2 release")]
19-
public class DSCv3ResourceCommands : DSCv3ResourceTestBase
19+
public class DSCv3PackageResourceCommand : DSCv3ResourceTestBase
2020
{
2121
private const string DefaultPackageIdentifier = Constants.ExeInstallerPackageId;
2222
private const string DefaultPackageLowVersion = "1.0.0.0";
@@ -152,9 +152,7 @@ public void Package_Test_NotPresent()
152152
Assert.AreEqual(packageResourceData.Identifier, output.Identifier);
153153
Assert.False(output.InDesiredState);
154154

155-
Assert.IsNotNull(diff);
156-
Assert.AreEqual(1, diff.Count);
157-
Assert.AreEqual(ExistPropertyName, diff[0]);
155+
AssertDiffState(diff, [ ExistPropertyName ]);
158156
}
159157

160158
/// <summary>

src/AppInstallerCLIE2ETests/DSCv3ResourceTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected static string[] GetOutputLines(string output)
9797
}
9898

9999
/// <summary>
100-
/// Asserts the the output is a single line and deserializes that line as JSON.
100+
/// Asserts that the output is a single line and deserializes that line as JSON.
101101
/// </summary>
102102
/// <typeparam name="T">The type to deserialize from JSON.</typeparam>
103103
/// <param name="output">The output stream from a DSC v3 resource command.</param>
@@ -111,7 +111,7 @@ protected static T GetSingleOutputLineAs<T>(string output)
111111
}
112112

113113
/// <summary>
114-
/// Asserts the the output is two lines and deserializes them as a JSON object and JSON string array.
114+
/// Asserts that the output is two lines and deserializes them as a JSON object and JSON string array.
115115
/// </summary>
116116
/// <typeparam name="T">The type to deserialize from JSON.</typeparam>
117117
/// <param name="output">The output stream from a DSC v3 resource command.</param>

0 commit comments

Comments
 (0)