Skip to content

Commit c36df80

Browse files
Add XML documentation to Umbrella.Testing.Architecture public API
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e5f89cd commit c36df80

3 files changed

Lines changed: 67 additions & 1 deletion

File tree

Testing/src/Umbrella.Testing.Architecture/Umbrella.Testing.Architecture.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<PackageId>Umbrella.Testing.Architecture</PackageId>
66
<Description>Abstract base test classes enforcing Umbrella layer dependency and implementation visibility rules using NetArchTest.Rules and xunit.v3</Description>
7-
<NoWarn>$(NoWarn);CA1707;CS1591</NoWarn>
7+
<NoWarn>$(NoWarn);CA1707</NoWarn>
88
</PropertyGroup>
99

1010
<ItemGroup>

Testing/src/Umbrella.Testing.Architecture/UmbrellaImplementationVisibilityTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,27 @@
44

55
namespace Umbrella.Testing.Architecture;
66

7+
/// <summary>
8+
/// Abstract base class providing xunit.v3 tests that enforce <c>internal sealed</c> visibility
9+
/// on all concrete repository, service, file-handler, and authorization-handler implementations.
10+
/// </summary>
11+
/// <remarks>
12+
/// Inherit from this class and override the abstract <see cref="CoreLogic"/> property.
13+
/// Override <see cref="CoreData"/> if the project has a data layer; tests for absent layers
14+
/// are reported as skipped rather than failed.
15+
/// </remarks>
716
public abstract class UmbrellaImplementationVisibilityTests
817
{
18+
/// <summary>
19+
/// Gets the assembly for the <c>Core.Data</c> layer, or <see langword="null"/> if the project
20+
/// has no data layer (e.g. Optimizely sites that rely on Remarkable.Optimizely packages).
21+
/// </summary>
922
protected virtual Assembly? CoreData => null;
23+
24+
/// <summary>Gets the assembly for the <c>Core.Logic</c> layer.</summary>
1025
protected abstract Assembly CoreLogic { get; }
1126

27+
/// <summary>Verifies that all classes named <c>*Repository</c> in <c>Core.Data</c> are <c>internal sealed</c>.</summary>
1228
[Fact]
1329
public void CoreData_Repositories_AreInternalSealed()
1430
{
@@ -18,14 +34,17 @@ public void CoreData_Repositories_AreInternalSealed()
1834
AssertInternalSealed(CoreData, "Repository$");
1935
}
2036

37+
/// <summary>Verifies that all classes named <c>*Service</c> in <c>Core.Logic</c> are <c>internal sealed</c>.</summary>
2138
[Fact]
2239
public void CoreLogic_Services_AreInternalSealed() =>
2340
AssertInternalSealed(CoreLogic, "Service$");
2441

42+
/// <summary>Verifies that all classes named <c>*FileHandler</c> in <c>Core.Logic</c> are <c>internal sealed</c>.</summary>
2543
[Fact]
2644
public void CoreLogic_FileHandlers_AreInternalSealed() =>
2745
AssertInternalSealed(CoreLogic, "FileHandler$");
2846

47+
/// <summary>Verifies that all classes named <c>*AuthorizationHandler</c> in <c>Core.Logic</c> are <c>internal sealed</c>.</summary>
2948
[Fact]
3049
public void CoreLogic_AuthorizationHandlers_AreInternalSealed() =>
3150
AssertInternalSealed(CoreLogic, "AuthorizationHandler$");

Testing/src/Umbrella.Testing.Architecture/UmbrellaLayerDependencyTests.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,55 @@
44

55
namespace Umbrella.Testing.Architecture;
66

7+
/// <summary>
8+
/// Abstract base class providing xunit.v3 tests that enforce layer dependency direction
9+
/// across the standard Umbrella project structure.
10+
/// </summary>
11+
/// <remarks>
12+
/// Inherit from this class and override the abstract properties to supply the assembly
13+
/// for each layer. Optional layers (<see cref="CoreData"/>, <see cref="WebServerModels"/>,
14+
/// <see cref="WebServerModelFactories"/>, <see cref="WebShared"/>, <see cref="WebClientData"/>)
15+
/// default to <see langword="null"/>; tests for absent layers are reported as skipped rather
16+
/// than failed.
17+
/// </remarks>
718
public abstract class UmbrellaLayerDependencyTests
819
{
20+
/// <summary>Gets the root namespace prefix for the project (e.g. <c>"IndyRecords"</c>).</summary>
921
protected abstract string NamespacePrefix { get; }
22+
23+
/// <summary>Gets the assembly for the <c>Core.Domain</c> layer.</summary>
1024
protected abstract Assembly CoreDomain { get; }
25+
26+
/// <summary>
27+
/// Gets the assembly for the <c>Core.Data</c> layer, or <see langword="null"/> if the project
28+
/// has no data layer (e.g. Optimizely sites that rely on Remarkable.Optimizely packages).
29+
/// </summary>
1130
protected virtual Assembly? CoreData => null;
31+
32+
/// <summary>Gets the assembly for the <c>Core.Logic</c> layer.</summary>
1233
protected abstract Assembly CoreLogic { get; }
34+
35+
/// <summary>
36+
/// Gets the assembly for the <c>Web.Server.Models</c> layer, or <see langword="null"/> if absent.
37+
/// </summary>
1338
protected virtual Assembly? WebServerModels => null;
39+
40+
/// <summary>
41+
/// Gets the assembly for the <c>Web.Server.ModelFactories</c> layer, or <see langword="null"/> if absent.
42+
/// </summary>
1443
protected virtual Assembly? WebServerModelFactories => null;
44+
45+
/// <summary>
46+
/// Gets the assembly for the <c>Web.Shared</c> layer, or <see langword="null"/> if absent.
47+
/// </summary>
1548
protected virtual Assembly? WebShared => null;
49+
50+
/// <summary>
51+
/// Gets the assembly for the <c>Web.Client.Data</c> layer, or <see langword="null"/> if absent.
52+
/// </summary>
1653
protected virtual Assembly? WebClientData => null;
1754

55+
/// <summary>Verifies that <c>Core.Domain</c> does not reference <c>Core.Data</c>.</summary>
1856
[Fact]
1957
public void CoreDomain_DoesNotDependOnCoreData()
2058
{
@@ -24,14 +62,17 @@ public void CoreDomain_DoesNotDependOnCoreData()
2462
AssertNoDependency(CoreDomain, $"{NamespacePrefix}.Core.Data");
2563
}
2664

65+
/// <summary>Verifies that <c>Core.Domain</c> does not reference <c>Core.Logic</c>.</summary>
2766
[Fact]
2867
public void CoreDomain_DoesNotDependOnCoreLogic() =>
2968
AssertNoDependency(CoreDomain, $"{NamespacePrefix}.Core.Logic");
3069

70+
/// <summary>Verifies that <c>Core.Domain</c> does not reference any <c>Web</c> layer.</summary>
3171
[Fact]
3272
public void CoreDomain_DoesNotDependOnWebLayer() =>
3373
AssertNoDependency(CoreDomain, $"{NamespacePrefix}.Web");
3474

75+
/// <summary>Verifies that <c>Core.Data</c> does not reference <c>Core.Logic</c>.</summary>
3576
[Fact]
3677
public void CoreData_DoesNotDependOnCoreLogic()
3778
{
@@ -41,6 +82,7 @@ public void CoreData_DoesNotDependOnCoreLogic()
4182
AssertNoDependency(CoreData, $"{NamespacePrefix}.Core.Logic");
4283
}
4384

85+
/// <summary>Verifies that <c>Core.Data</c> does not reference any <c>Web</c> layer.</summary>
4486
[Fact]
4587
public void CoreData_DoesNotDependOnWebLayer()
4688
{
@@ -50,10 +92,12 @@ public void CoreData_DoesNotDependOnWebLayer()
5092
AssertNoDependency(CoreData, $"{NamespacePrefix}.Web");
5193
}
5294

95+
/// <summary>Verifies that <c>Core.Logic</c> does not reference any <c>Web</c> layer.</summary>
5396
[Fact]
5497
public void CoreLogic_DoesNotDependOnWebLayer() =>
5598
AssertNoDependency(CoreLogic, $"{NamespacePrefix}.Web");
5699

100+
/// <summary>Verifies that <c>Web.Server.Models</c> does not reference <c>Core.Logic</c>.</summary>
57101
[Fact]
58102
public void WebServerModels_DoesNotDependOnCoreLogic()
59103
{
@@ -63,6 +107,7 @@ public void WebServerModels_DoesNotDependOnCoreLogic()
63107
AssertNoDependency(WebServerModels, $"{NamespacePrefix}.Core.Logic");
64108
}
65109

110+
/// <summary>Verifies that <c>Web.Server.Models</c> does not reference <c>Core.Data</c>.</summary>
66111
[Fact]
67112
public void WebServerModels_DoesNotDependOnCoreData()
68113
{
@@ -72,6 +117,7 @@ public void WebServerModels_DoesNotDependOnCoreData()
72117
AssertNoDependency(WebServerModels, $"{NamespacePrefix}.Core.Data");
73118
}
74119

120+
/// <summary>Verifies that <c>Web.Shared</c> does not reference any <c>Core</c> layer.</summary>
75121
[Fact]
76122
public void WebShared_DoesNotDependOnCore()
77123
{
@@ -81,6 +127,7 @@ public void WebShared_DoesNotDependOnCore()
81127
AssertNoDependency(WebShared, $"{NamespacePrefix}.Core");
82128
}
83129

130+
/// <summary>Verifies that <c>Web.Client.Data</c> does not reference any <c>Core</c> layer.</summary>
84131
[Fact]
85132
public void WebClientData_DoesNotDependOnCore()
86133
{

0 commit comments

Comments
 (0)