Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.
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 @@ -4,7 +4,7 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="aweXpect" Version="2.34.0" />
<PackageVersion Include="aweXpect.Core" Version="2.31.1" />
<PackageVersion Include="aweXpect.Core" Version="2.32.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Nullable" Version="1.3.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ public sealed partial class AssemblyFilters
{
public sealed class WhichHaveDependenciesOnlyOn
{
/// <summary>
/// Excludes the framework facade assemblies that differ between target frameworks (e.g. <c>netstandard</c> on
/// <c>net48</c>), so that the tests only have to whitelist the actual non-framework dependencies.
/// </summary>
private static CustomizationLifetime ExcludeFrameworkAssemblies()
=> Customize.aweXpect.Reflection().ExcludedAssemblyPrefixes
.Set([
.. Customize.aweXpect.Reflection().ExcludedAssemblyPrefixes.Get(), "netstandard", "WindowsBase",
]);

public sealed class Tests
{
[Fact]
Expand Down Expand Up @@ -45,8 +35,6 @@ await That(assemblies.GetDescription())
[Fact]
public async Task ShouldFilterForAssembliesDependingOnlyOnAllowed()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Filtered.Assemblies assemblies = In.Assemblies(typeof(In).Assembly)
.WhichHaveDependenciesOnlyOn("aweXpect.Core");

Expand All @@ -56,8 +44,6 @@ public async Task ShouldFilterForAssembliesDependingOnlyOnAllowed()
[Fact]
public async Task ShouldSupportAsWildcard()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Filtered.Assemblies assemblies = In.Assemblies(typeof(In).Assembly)
.WhichHaveDependenciesOnlyOn("aweXpect.*").AsWildcard();

Expand All @@ -67,8 +53,6 @@ public async Task ShouldSupportAsWildcard()
[Fact]
public async Task ShouldSupportIgnoringCase()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Filtered.Assemblies assemblies = In.Assemblies(typeof(In).Assembly)
.WhichHaveDependenciesOnlyOn("awexpect.core").IgnoringCase();

Expand Down
2 changes: 1 addition & 1 deletion Tests/aweXpect.Reflection.Tests/InTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public async Task AllLoadedAssemblies_ShouldContainMultipleAssemblies()
{
Filtered.Assemblies sut = In.AllLoadedAssemblies();

await That(sut).HasCount().AtLeast(5);
await That(sut).HasCount().AtLeast(4);
await That(sut).All().Satisfy(x => !x.FullName!.StartsWith("System."));
await That(sut.GetDescription()).IsEqualTo("in all loaded assemblies");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,11 @@ public sealed partial class ThatAssemblies
{
public sealed class HaveDependenciesOnlyOn
{
/// <summary>
/// Excludes the framework facade assemblies that differ between target frameworks (e.g. <c>netstandard</c> on
/// <c>net48</c>), so that the tests only have to whitelist the actual non-framework dependencies.
/// </summary>
private static CustomizationLifetime ExcludeFrameworkAssemblies()
=> Customize.aweXpect.Reflection().ExcludedAssemblyPrefixes
.Set([
.. Customize.aweXpect.Reflection().ExcludedAssemblyPrefixes.Get(), "netstandard", "WindowsBase",
]);

public sealed class Tests
{
[Fact]
public async Task WhenAllAssembliesDependOnlyOnAllowed_ShouldSucceed()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Filtered.Assemblies subject = In.Assemblies(typeof(In).Assembly);

async Task Act()
Expand All @@ -39,8 +27,6 @@ async Task Act()
[Fact]
public async Task WhenAllowedMatchesAsWildcard_ShouldSucceed()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Filtered.Assemblies subject = In.Assemblies(typeof(In).Assembly);

async Task Act()
Expand All @@ -54,8 +40,6 @@ async Task Act()
[Fact]
public async Task WhenAnAssemblyDependsOnDisallowedAssembly_ShouldFail()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Filtered.Assemblies subject = In.AssemblyContaining<PublicAbstractClass>();

async Task Act()
Expand All @@ -79,8 +63,6 @@ public sealed class NegatedTests
[Fact]
public async Task WhenAllAssembliesDependOnlyOnAllowed_ShouldFail()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Filtered.Assemblies subject = In.Assemblies(typeof(In).Assembly);

async Task Act()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,11 @@ public sealed partial class ThatAssembly
{
public sealed class HasDependenciesOnlyOn
{
/// <summary>
/// Excludes the framework facade assemblies that differ between target frameworks (e.g. <c>netstandard</c> on
/// <c>net48</c>), so that the tests only have to whitelist the actual non-framework dependencies.
/// </summary>
private static CustomizationLifetime ExcludeFrameworkAssemblies()
=> Customize.aweXpect.Reflection().ExcludedAssemblyPrefixes
.Set([
.. Customize.aweXpect.Reflection().ExcludedAssemblyPrefixes.Get(), "netstandard", "WindowsBase",
]);

public sealed class Tests
{
[Fact]
public async Task WhenAllowedMatchesAsWildcard_ShouldSucceed()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Assembly subject = typeof(In).Assembly;

async Task Act()
Expand All @@ -39,8 +27,6 @@ async Task Act()
[Fact]
public async Task WhenAllowedMatchesIgnoringCase_ShouldSucceed()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Assembly subject = typeof(In).Assembly;

async Task Act()
Expand Down Expand Up @@ -72,8 +58,6 @@ but it also had dependencies on [*]
[Fact]
public async Task WhenAssemblyDependsOnlyOnAllowed_ShouldSucceed()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Assembly subject = typeof(In).Assembly;

async Task Act()
Expand Down Expand Up @@ -121,8 +105,6 @@ async Task Act()
[Fact]
public async Task WhenAssemblyDependsOnlyOnAllowed_ShouldFail()
{
using CustomizationLifetime _ = ExcludeFrameworkAssemblies();

Assembly subject = typeof(In).Assembly;

async Task Act()
Expand Down
Loading