Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(mods): Bump eng from 39060c0 to c3b635f #248

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="$(DirEngineeringSettings)sln.packages.props" />

<ItemGroup>
<GlobalPackageReference Include="CSharpier.MSBuild" Version="0.25.0" />
<GlobalPackageReference Include="CSharpier.MSBuild" Version="0.26.2" />
<GlobalPackageReference Include="GitVersion.MsBuild" Version="5.12.0" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4" />
Expand Down
2 changes: 1 addition & 1 deletion eng
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.MSTest/BugAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.MSTest;

using NetEvolve.Extensions.MSTest.Internal;
using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Bug, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.MSTest/EpicAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.MSTest;

using NetEvolve.Extensions.MSTest.Internal;
using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Epic, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.MSTest/FeatureAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.MSTest;

using NetEvolve.Extensions.MSTest.Internal;
using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Feature, with optional Id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace NetEvolve.Extensions.MSTest.Internal;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

/// <inheritdoc/>
[System.Diagnostics.CodeAnalysis.SuppressMessage(
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.MSTest/IssueAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.MSTest;

using NetEvolve.Extensions.MSTest.Internal;
using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Issue, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.MSTest/UserStoryAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.MSTest;

using NetEvolve.Extensions.MSTest.Internal;
using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as UserStory, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.MSTest/WorkItemAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.MSTest;

using NetEvolve.Extensions.MSTest.Internal;
using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as WorkItem, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.NUnit/BugAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.NUnit;

using NetEvolve.Extensions.NUnit.Internal;
using System;
using NetEvolve.Extensions.NUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Bug, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.NUnit/ContinuousTestBase.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace NetEvolve.Extensions.NUnit;

using System.Threading.Tasks;
using global::NUnit.Framework;
using global::NUnit.Framework.Interfaces;
using System.Threading.Tasks;

/// <summary>
/// Basic implementation for the execution of continuous tests, based on <see cref="OrderAttribute"/>.
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.NUnit/EpicAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.NUnit;

using NetEvolve.Extensions.NUnit.Internal;
using System;
using NetEvolve.Extensions.NUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Epic, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.NUnit/FeatureAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.NUnit;

using NetEvolve.Extensions.NUnit.Internal;
using System;
using NetEvolve.Extensions.NUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Feature, with optional Id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.NUnit;

using global::NUnit.Framework;
using System;
using global::NUnit.Framework;

/// <summary>
/// Attribute used to decorate a test class or method as IntegrationTest.
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.NUnit/IssueAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.NUnit;

using NetEvolve.Extensions.NUnit.Internal;
using System;
using NetEvolve.Extensions.NUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Issue, with optional Id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace NetEvolve.Extensions.NUnit;

using global::NUnit.Framework;
using System;
using System.Diagnostics.CodeAnalysis;
using global::NUnit.Framework;

/// <summary>
/// Sets the number of worker threads taking into account the available
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.NUnit/UserStoryAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.NUnit;

using NetEvolve.Extensions.NUnit.Internal;
using System;
using NetEvolve.Extensions.NUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as UserStory, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.NUnit/WorkItemAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.NUnit;

using NetEvolve.Extensions.NUnit.Internal;
using System;
using NetEvolve.Extensions.NUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as WorkItem, with optional Id
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.XUnit/BugAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.XUnit;

using NetEvolve.Extensions.XUnit.Internal;
using System;
using NetEvolve.Extensions.XUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as Bug, with optional Id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace NetEvolve.Extensions.XUnit.Internal;

using NetEvolve.Extensions.XUnit;
using System;
using System.Diagnostics.CodeAnalysis;
using NetEvolve.Extensions.XUnit;
using Xunit.Sdk;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.XUnit.Internal;

using NetEvolve.Extensions.XUnit;
using System.Collections.Generic;
using NetEvolve.Extensions.XUnit;
using Xunit.Abstractions;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetEvolve.Extensions.XUnit.Internal;

using NetEvolve.Extensions.XUnit;
using System.Collections.Generic;
using NetEvolve.Extensions.XUnit;
using Xunit.Abstractions;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.XUnit/SetCultureAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace NetEvolve.Extensions.XUnit;

using NetEvolve.Extensions.XUnit.Internal;
using System;
using System.Globalization;
using System.Reflection;
using NetEvolve.Extensions.XUnit.Internal;

/// <summary>
/// Based on the value passed as culture, the marked test is executed.
Expand Down
2 changes: 1 addition & 1 deletion src/NetEvolve.Extensions.XUnit/SetUICultureAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace NetEvolve.Extensions.XUnit;

using NetEvolve.Extensions.XUnit.Internal;
using System;
using System.Globalization;
using NetEvolve.Extensions.XUnit.Internal;

/// <summary>
/// Based on the value passed as UI culture, the marked test is executed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace NetEvolve.Extensions.MSTest.Tests.Unit;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using VerifyTests;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace NetEvolve.Extensions.MSTest.Tests.Unit;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using NetEvolve.Extensions.MSTest.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NetEvolve.Extensions.MSTest.Internal;
using VerifyMSTest;
using VerifyTests;

Expand All @@ -23,12 +23,21 @@ protected IEnumerable<KeyValuePair<string, string>> GetProperties(
[CallerMemberName] string? methodName = null
)
{
if (string.IsNullOrWhiteSpace(methodName)) { throw new ArgumentNullException(nameof(methodName)); }
if (string.IsNullOrWhiteSpace(methodName))
{
throw new ArgumentNullException(nameof(methodName));
}

var owningType = GetType();
var methodInfo = owningType.GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
var methodInfo = owningType.GetMethod(
methodName,
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance
);

if (methodInfo is null) { return Enumerable.Empty<KeyValuePair<string, string>>(); }
if (methodInfo is null)
{
return Enumerable.Empty<KeyValuePair<string, string>>();
}

var categories = GetTestCategoryBaseAttributes(methodInfo).ToArray();
if (categories is not null)
Expand All @@ -38,62 +47,106 @@ protected IEnumerable<KeyValuePair<string, string>> GetProperties(

if (categories is not null)
{
categories = categories.Concat(GetTestCategoryBaseAttributes(owningType.Module.Assembly)).ToArray();
categories = categories
.Concat(GetTestCategoryBaseAttributes(owningType.Module.Assembly))
.ToArray();
}

if (categories is null)
{
return Array.Empty<KeyValuePair<string, string>>();
}

return categories.Where(x => x.Key is not null && !string.IsNullOrWhiteSpace(x.Value)).Distinct();
return categories
.Where(x => x.Key is not null && !string.IsNullOrWhiteSpace(x.Value))
.Distinct();
}

private IEnumerable<KeyValuePair<string, string>> GetTestCategoryBaseAttributes(Assembly assembly)
private IEnumerable<KeyValuePair<string, string>> GetTestCategoryBaseAttributes(
Assembly assembly
)
{
if (assembly is null) { yield break; }
if (assembly is null)
{
yield break;
}

var attributes = assembly.GetCustomAttributes<TestCategoryBaseAttribute>();
if (attributes is null) { yield break; }
if (attributes is null)
{
yield break;
}

foreach (var attribute in attributes)
{
if (attribute is null) { continue; }
if (attribute is null)
{
continue;
}

foreach (var testCategory in attribute.TestCategories)
{
if (string.IsNullOrWhiteSpace(testCategory)) { continue; }
if (string.IsNullOrWhiteSpace(testCategory))
{
continue;
}

yield return new KeyValuePair<string, string>("TestCategory", testCategory);

if (attribute is TestCategoryWithIdBaseAttribute attributeWithId && !string.IsNullOrWhiteSpace(attributeWithId.Id))
if (
attribute is TestCategoryWithIdBaseAttribute attributeWithId
&& !string.IsNullOrWhiteSpace(attributeWithId.Id)
)
{
yield return new KeyValuePair<string, string>(testCategory, attributeWithId.Id!);
yield return new KeyValuePair<string, string>(
testCategory,
attributeWithId.Id!
);
}
}
}
}

private IEnumerable<KeyValuePair<string, string>> GetTestCategoryBaseAttributes(MemberInfo? member)
private IEnumerable<KeyValuePair<string, string>> GetTestCategoryBaseAttributes(
MemberInfo? member
)
{
if (member is null) { yield break; }
if (member is null)
{
yield break;
}

var attributes = member.GetCustomAttributes<TestCategoryBaseAttribute>(true);
if (attributes is null) { yield break; }
if (attributes is null)
{
yield break;
}

foreach (var attribute in attributes)
{
if (attribute is null) { continue; }
if (attribute is null)
{
continue;
}

foreach (var testCategory in attribute.TestCategories)
{
if (string.IsNullOrWhiteSpace(testCategory)) { continue; }
if (string.IsNullOrWhiteSpace(testCategory))
{
continue;
}

yield return new KeyValuePair<string, string>("TestCategory", testCategory);

if (attribute is TestCategoryWithIdBaseAttribute attributeWithId && !string.IsNullOrWhiteSpace(attributeWithId.Id))
if (
attribute is TestCategoryWithIdBaseAttribute attributeWithId
&& !string.IsNullOrWhiteSpace(attributeWithId.Id)
)
{
yield return new KeyValuePair<string, string>(testCategory, attributeWithId.Id!);
yield return new KeyValuePair<string, string>(
testCategory,
attributeWithId.Id!
);
}
}
}
Expand Down
Loading
Loading