Skip to content
Open
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
39 changes: 39 additions & 0 deletions .github/instructions/testing.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,45 @@ dotnet test ... --filter "FullyQualifiedName=Namespace.ClassName.MethodName"

## Writing Tests

### Test Documentation Requirements

Comment thread
paulmedynski marked this conversation as resolved.
To keep tests maintainable for contributors and AI agents, test intent must be documented at
class and method level.

#### Required XML Documentation
- Add XML `<summary>` comments to every test class.
- Add XML `<summary>` comments to every test method (`[Fact]`, `[Theory]`, conditional variants).
- For helper methods used by tests, add XML `<summary>` comments and XML `<param>` / `<returns>`
where applicable.
- For fixture and collection types, add XML `<summary>` comments describing why the fixture exists
(for example, serialization of console-mutating tests).

#### What the Comments Must Explain
- The behavior/contract being tested (not just restating the method name).
- Why the scenario matters (for example: regression guard, parsing contract, sync/async parity,
isolation requirement).
- For helper methods, what side effects occur (for example console redirection, file system
copying, process execution) and why they are needed.

#### Style Guidance
- Keep comments concise and factual.
- Prefer behavior-focused wording over implementation trivia.
- Avoid comments that merely repeat obvious code.
- Use inline comments inside test methods only for non-obvious setup/act/assert details.

#### Example
```csharp
/// <summary>
/// Ensures malformed connection strings return a non-zero exit code and emit a parse error
/// without verbose exception details.
/// </summary>
[Fact]
public void AppRunWithMalformedConnectionStringReturnsOneAndWritesParseError()
{
// Arrange / Act / Assert
}
```

### Test Structure
```csharp
public class FeatureNameTests
Expand Down
32 changes: 0 additions & 32 deletions doc/apps/AzureAuthentication/Directory.Packages.props

This file was deleted.

165 changes: 0 additions & 165 deletions doc/apps/AzureAuthentication/README.md

This file was deleted.

6 changes: 2 additions & 4 deletions src/Microsoft.Data.SqlClient.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<Platform Solution="*|x86" Project="x86" />
</Project>
</Folder>
<Folder Name="/doc/apps/">
<Project Path="../doc/apps/AzureAuthentication/AzureAuthentication.csproj" />
</Folder>
<Folder Name="/doc/snippets/" />
<Folder Name="/doc/snippets/Microsoft.Data.Sql/">
<File Path="../doc/snippets/Microsoft.Data.Sql/SqlDataSourceEnumerator.xml" />
Expand Down Expand Up @@ -170,7 +167,6 @@
<Folder Name="/src/Microsoft.Data.SqlClient/src/">
<Project Path="Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj" />
</Folder>
<Folder Name="/src/Microsoft.Data.SqlClient/tests/" />
<Folder Name="/src/Microsoft.SqlServer.Server/">
<Project Path="Microsoft.SqlServer.Server/Microsoft.SqlServer.Server.csproj" />
</Folder>
Expand Down Expand Up @@ -215,4 +211,6 @@
<Project Path="Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj" />
<Project Path="Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj" />
</Folder>
<Project Path="../tools/PackageCompatibility/src/PackageCompatibility.csproj" />
<Project Path="../tools/PackageCompatibility/test/PackageCompatibility.Test.csproj" />
</Solution>
44 changes: 44 additions & 0 deletions tools/PackageCompatibility/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- We purposely do not include any parent Directory.Packages.props files. -->

<PropertyGroup>
<!-- Use the following package versions if not supplied. -->
<AbstractionsVersion>1.0.0</AbstractionsVersion>
<AkvProviderVersion>7.0.0</AkvProviderVersion>
<LoggingVersion>1.0.0</LoggingVersion>
<SqlClientVersion>7.0.1</SqlClientVersion>
<SqlServerVersion>1.0.0</SqlServerVersion>

<!-- We omit referencing the Azure package entirely by default. -->
</PropertyGroup>

<!-- SqlClient Packages -->
<ItemGroup>
<!--
Normal apps wouldn't explicitly reference these 2 packages, but we do here to force the
desired versions. This helps detect version conflicts.
-->
<PackageVersion Include="Microsoft.Data.SqlClient.Extensions.Abstractions" Version="$(AbstractionsVersion)" />
<PackageVersion Include="Microsoft.Data.SqlClient.Internal.Logging" Version="$(LoggingVersion)" />

<!-- These are normal references for apps. -->
<PackageVersion Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="$(AkvProviderVersion)" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="$(SqlClientVersion)" />
<PackageVersion Include="Microsoft.SqlServer.Server" Version="$(SqlServerVersion)" />

<!-- Declare a version for the Azure package if one was specified. -->
<PackageVersion
Include="Microsoft.Data.SqlClient.Extensions.Azure"
Version="$(AzureVersion)"
Condition="'$(AzureVersion)' != ''" />
</ItemGroup>

<!-- Other Packages -->
<ItemGroup>
<PackageVersion Include="System.CommandLine" Version="2.0.6" />
<PackageVersion Include="xunit.v3" Version="4.0.0-pre.81" />
</ItemGroup>

</Project>
Loading
Loading