Microsoft.Learn.AzureFunctionsTesting.Core 1.2.0

Prefix Reserved
dotnet add package Microsoft.Learn.AzureFunctionsTesting.Core --version 1.2.0
                    
NuGet\Install-Package Microsoft.Learn.AzureFunctionsTesting.Core -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Learn.AzureFunctionsTesting.Core" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Learn.AzureFunctionsTesting.Core" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Learn.AzureFunctionsTesting.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Learn.AzureFunctionsTesting.Core --version 1.2.0
                    
#r "nuget: Microsoft.Learn.AzureFunctionsTesting.Core, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Learn.AzureFunctionsTesting.Core@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Learn.AzureFunctionsTesting.Core&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Learn.AzureFunctionsTesting.Core&version=1.2.0
                    
Install as a Cake Tool

Microsoft.Learn.AzureFunctionsTesting.Core

This package contains the core interfaces used by extension authors to create plugins for the testing system.

Creating a extension

There are three steps to creating an extension:

  1. Create a class that implements IFunctionTestPlugin
  2. Create an extension method for IFunctionTestConfigurationBuilder where you register your plugin
  3. [Optional] Create an extension method for IFunctionFixture that lets you access the plugin from tests

Creating the plugin

The InitializeAsync() method will get called once when the test run starts and you should use it to do any test suite setup. The DisposeAsync() method will get called once when the test run completes and you can use it ot do any test suite teardown. You can expose a property (ex: CosmosClient, Database, etc) that you can get back to from individual tests to do any per-test setup.

Registering your plugin

Create an extension method on IFunctionTestConfigurationBuilder. You must call builder.RegisterPlugin() in order for your plugin to get called by the test runtime. You can also optionally register any environment variables which will get converted into IConfiguration values that can be accessed from your function app.

Use your plugin in tests

Create an extension method on IFunctionFixture and call fixture.GetPlugin() to get a reference to your plugin. Use the same name you used when registering the plugin. You can access the custom property on your plugin to do per-test arrangement (inserting database records, etc).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Microsoft.Learn.AzureFunctionsTesting.Core:

Package Downloads
Microsoft.Learn.AzureFunctionsTesting

This library provides a helpful framework that allows you to test your Azure Functions Http Triggers in a manner similar to how ASP.NET Core integration testing works.

Microsoft.Learn.AzureFunctionsTesting.Extension.DebugProcess

An extension for the Microsoft.Learn.AzureFunctionsTesting framework to allow stepping into debugged tests across processes.

Microsoft.Learn.AzureFunctionsTesting.Extension.MockHttpServer

An extension for the Microsoft.Learn.AzureFunctionsTesting framework to allow mocking any HTTP server.

Microsoft.Learn.AzureFunctionsTesting.Extension.MockCosmos

An extension for the Microsoft.Learn.AzureFunctionsTesting framework to allow mocking Cosmos DB.

Microsoft.Learn.AzureFunctionsTesting.Extension.MockSql

An extension for the Microsoft.Learn.AzureFunctionsTesting framework to allow mocking SQL Server DBs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 5,780 3/18/2025
1.1.0 13,180 9/24/2024
1.0.0 315 8/15/2024