-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for configure mixed elevation (#4487)
- Loading branch information
Showing
36 changed files
with
411 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/Microsoft.Management.Configuration.UnitTests/Helpers/InProcAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// ----------------------------------------------------------------------------- | ||
// <copyright file="InProcAttribute.cs" company="Microsoft Corporation"> | ||
// Copyright (c) Microsoft Corporation. Licensed under the MIT License. | ||
// </copyright> | ||
// ----------------------------------------------------------------------------- | ||
|
||
namespace Microsoft.Management.Configuration.UnitTests.Helpers | ||
{ | ||
using System; | ||
using Xunit.Sdk; | ||
|
||
/// <summary> | ||
/// Trait used to mark a test as only for the in proc scenario. | ||
/// </summary> | ||
[TraitDiscoverer(InProcDiscoverer.TypeName, Constants.AssemblyNameForTraits)] | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)] | ||
public class InProcAttribute : Attribute, ITraitAttribute | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="InProcAttribute"/> class. | ||
/// </summary> | ||
public InProcAttribute() | ||
{ | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/Microsoft.Management.Configuration.UnitTests/Helpers/InProcDiscoverer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// ----------------------------------------------------------------------------- | ||
// <copyright file="InProcDiscoverer.cs" company="Microsoft Corporation"> | ||
// Copyright (c) Microsoft Corporation. Licensed under the MIT License. | ||
// </copyright> | ||
// ----------------------------------------------------------------------------- | ||
|
||
namespace Microsoft.Management.Configuration.UnitTests.Helpers | ||
{ | ||
using System.Collections.Generic; | ||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
/// <summary> | ||
/// Enables integration with xUnit trait system. | ||
/// </summary> | ||
public class InProcDiscoverer : ITraitDiscoverer | ||
{ | ||
/// <summary> | ||
/// The type name for this discoverer. | ||
/// </summary> | ||
public const string TypeName = Constants.NamespaceNameForTraits + ".InProcDiscoverer"; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="InProcDiscoverer"/> class. | ||
/// </summary> | ||
public InProcDiscoverer() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Gets the trait information for the InProcAttribute. | ||
/// </summary> | ||
/// <param name="traitAttribute">The trait information.</param> | ||
/// <returns>Trait name/value pairs.</returns> | ||
public IEnumerable<KeyValuePair<string, string>> GetTraits(IAttributeInfo traitAttribute) | ||
{ | ||
yield return new KeyValuePair<string, string>("Category", "InProc"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.