Table of Contents

Class RepositoryLintTests

Namespace
ProjectTemplate.Web.Tests
Assembly
ProjectTemplate.Web.Tests.dll

Checks that apply to this repository's own sources rather than to generated application behavior.

public sealed class RepositoryLintTests
Inheritance
RepositoryLintTests
Inherited Members

Remarks

These read files from the repository working tree, including .template.content, which exists only here and never in a generated project. They are excluded from the template for that reason: a consumer running them would be asserting things about a layout they do not have, or about coding choices that are theirs to make.

Methods

Appsettings_DoNotContainStaleOpenTelemetryServiceVersion()

Verifies that no repository appsettings file carries a stale OpenTelemetry service version value.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/RepositoryLintTests.cs", 73)]
public void Appsettings_DoNotContainStaleOpenTelemetryServiceVersion()

Remarks

Reads both src and the .template.content overlay, so it only makes sense in this repository.

RepositoryNuGetConfig_UsesOnlyNuGetOrg()

Verifies that repository restores do not require credentials for a private package source.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/RepositoryLintTests.cs", 116)]
public void RepositoryNuGetConfig_UsesOnlyNuGetOrg()

RepositoryRoot_HasSingleBuildEntryPoint()

Verifies that argument-free dotnet commands resolve the repository solution.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/RepositoryLintTests.cs", 135)]
public void RepositoryRoot_HasSingleBuildEntryPoint()

SourceFiles_DoNotUseUnsafeRawSqlOrManualCommandConstructionPatterns()

Verifies that repository sources avoid raw SQL and manual command construction patterns.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/RepositoryLintTests.cs", 30)]
public void SourceFiles_DoNotUseUnsafeRawSqlOrManualCommandConstructionPatterns()

Remarks

This is a convention for the template's own code. A generated application may have a legitimate reason to use ADO.NET directly, which is why this check does not ship.

TemplatePackageContent_ExcludesSqliteDatabaseArtifacts(string)

Verifies that recursive template package inputs exclude local SQLite database artifacts.

[Theory("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/RepositoryLintTests.cs", 148)]
[InlineData(new object?[] { "src" })]
[InlineData(new object?[] { "tests" })]
public void TemplatePackageContent_ExcludesSqliteDatabaseArtifacts(string contentRoot)

Parameters

contentRoot string

The recursive content root declared by the template package project.