DRN.Framework.Testing 0.6.0

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package DRN.Framework.Testing --version 0.6.0
                    
NuGet\Install-Package DRN.Framework.Testing -Version 0.6.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="DRN.Framework.Testing" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DRN.Framework.Testing" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="DRN.Framework.Testing" />
                    
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 DRN.Framework.Testing --version 0.6.0
                    
#r "nuget: DRN.Framework.Testing, 0.6.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 DRN.Framework.Testing@0.6.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=DRN.Framework.Testing&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=DRN.Framework.Testing&version=0.6.0
                    
Install as a Cake Tool

master develop Quality Gate Status

Security Rating Maintainability Rating Reliability Rating Vulnerabilities Bugs Lines of Code Coverage

Introduction

DRN.Framework.Testing package provides practical, effective helpers such as resourceful data attributes and test context.

This package enables a new encouraging testing technique called as DTT(Duran's Testing Technique). With DTT, any developer can write clean and hassle-free unit and integration tests without complexity.

QuickStart: Basics

Here's a basic test demonstration to take your attention and get you started:

    [Theory]
    [DataInline]
    public void DataInlineDemonstration(TestContext context, IMockable autoInlinedDependency)
    {
        context.ServiceCollection.AddApplicationServices();
        //Context wraps service provider and automagically replaces actual dependencies with auto inlined dependencies
        var dependentService = context.GetRequiredService<DependentService>();
        
        autoInlinedDependency.Max.Returns(int.MaxValue); //dependency is already mocked by NSubstitute
        dependentService.Max.Should().Be(int.MaxValue); //That is all. It is clean and effective 
    }

Table of Contents

  • Introduction
  • TestContext
  • ContainerContext
  • WebApplicationContext
  • DataAttributes
  • DebugOnly Tests
  • Settings and Data Providers
  • Global Usings
  • Example Test Project
  • Test snippet
  • Testing guide and DTT approach

Testing models used in the QuickStart


public static class ApplicationModule //Can be defined in Application Layer or in Hosted App
{
    public static void AddApplicationServices(this IServiceCollection serviceCollection)
    {
        serviceCollection.AddTransient<IMockable, ToBeRemovedService>(); //will be removed by test context because test method requested mocked interface
        serviceCollection.AddTransient<DependentService>(); //dependent service uses IMockable and Max property returns dependency's Max value
    }
}

public interface IMockable
{
    public int Max { get; }
}

public class ToBeRemovedService : IMockable
{
    public int Max { get; set; }
}

public class DependentService : IMockable
{
    private readonly IMockable _mockable;

    public DependentService(IMockable mockable)
    {
        _mockable = mockable;
    }

    public int Max => _mockable.Max;
}

QuickStart: Advanced Data Inline

  • DataInline will provide TestContext as first parameter.
  • Then it will provide inlined values.
  • Then it will provide auto inline missing values with AutoFixture.
  • AutoFixture will mock any interface requested with NSubstitute.
/// <param name="context"> Provided by DataInline even if it is not a compile time constant</param>
/// <param name="inlineData">Provided by DataInline</param>
/// <param name="autoInlinedData">DataInline will provide missing data with the help of AutoFixture</param>
/// <param name="autoInlinedMockable">DataInline will provide implementation mocked by NSubstitute</param>
[Theory]
[DataInline(99)]
public void TextContext_Should_Be_Created_From_TestContextData(TestContext context, int inlineData, Guid autoInlinedData, IMockable autoInlinedMockable)
{
    inlineData.Should().Be(99);
    autoInlinedData.Should().NotBeEmpty(); //guid generated by AutoFixture
    autoInlinedMockable.Max.Returns(int.MaxValue); //dependency mocked by NSubstitute

    context.ServiceCollection.AddApplicationServices(); //you can add services, modules defined in hosted app, application, infrastructure layer etc..
    var serviceProvider = context.BuildServiceProvider(); //appsettings.json added by convention. Context and service provider will be disposed by xunit
    serviceProvider.GetService<ToBeRemovedService>().Should().BeNull(); //Service provider behaviour demonstration

    var dependentService = serviceProvider.GetRequiredService<DependentService>();
    dependentService.Max.Should().Be(int.MaxValue);
}

TestContext

TestContext has following properties:

  • captures values provided to running test method, test method info and location.
  • provides ServiceCollection so that to be tested services and dependencies can be added before building ServiceProvider.
  • provides and implements lightweight ServiceProvider that contains default logging without any provider
    • ServiceProvider can provide services that depends on like ILogger<DefaultService>
    • logged data will not be leaked to anywhere since it has no logging provider.
  • provides ContainerContext
    • can start a postgres container, apply migrations for dbContexts derived from DrnContext and updates connection string configuration with a single line of code
  • provides WebApplicationContext
    • syncs TestContext service collection and service provider with provided application by WebApplicationFactory
  • provides IConfiguration and IAppSettings with SettingsProvider by using convention.
    • settings.json file can be found in the same folder with test
    • settings.json file can be found in the global Settings folder or Settings folder that stays in the test folder
    • Make sure file is copied to output directory
    • If no settings file is specified while calling BuildServiceProvider. appsettings.json file be searched by convention.
  • provides data file contents by using convention.
    • data file can be found in the same folder with test
    • data file can be found in the global Data folder or Data folder that stays in the test folder
    • Make sure file is copied to output directory
  • ServiceProvider provides utils provided with DRN.Framework.Utils' UtilsModule
  • BuildServiceProvider replaces dependencies that can be replaced with inlined interfaces.
  • ServiceProvider and TestContext will be disposed by xunit when test finishes

settings.json can be put in the same folder that test file belongs. This way providing and isolating test settings is much easier

    [Theory]
    [DataInline( "localhost")]
    public void TestContext_Should_Add_Settings_Json_To_Configuration(TestContext context, string value)
    {
        //settings.json file can be found in the same folder with test file, in the global Settings folder or Settings folder that stays in the same folder with test file
        context.GetRequiredService<IAppSettings>().GetRequiredSection("AllowedHosts").Value.Should().Be(value);
    }

data.txt can be put in the same folder that test file belongs. This way providing and isolating test data is much easier

    [Theory]
    [DataInline("data.txt", "Atatürk")]
    [DataInline("alternateData.txt", "Father of Turks")]
    public void TestContext_Should_Return_Test_Specific_Data(TestContext context, string dataPath, string data)
    {
        //data file can be found in the same folder with test file, in the global Data folder or Data folder that stays in the same folder with test file
        context.GetData(dataPath).Should().Be(data);
    }

ContainerContext

With ContainerContext and conventions you can easily write effective integration tests against your database dependencies

    [Theory]
    [DataInline]
    public async Task QAContext_Should_Add_Category(TestContext context)
    {
        context.ServiceCollection.AddSampleInfraServices();
        await context.ContainerContext.StartPostgresAndApplyMigrationsAsync();
        var qaContext = context.GetRequiredService<QAContext>();

        var category = new Category("dotnet8");
        qaContext.Categories.Add(category);
        await qaContext.SaveChangesAsync();
        category.Id.Should().BePositive();
    }
  • Application modules can be registered without any modification to TestContext
  • TestContext's ContainerContext
    • creates a postgresql container then scans TestContext's service collection for inherited DrnContexts.
    • Adds a connection strings to TestContext's configuration for each derived DrnContext according to convention.
  • TestContext acts as a ServiceProvider and when a service is requested it can build it from service collection with all dependencies.

WebApplicationContext

WebApplicationContext syncs TestContext service collection and service provider with provided application by WebApplicationFactory.

  • You can provide or override configurations and services to your program until you force WebApplicationFactory to build a Host such as creating HttpClient or requesting TestServer.
    [Theory]
    [DataInline]
    public async Task WebApplicationContext_Should_Provide_Configuration_To_Program(TestContext context)
    {
        var webApplication = context.WebApplicationContext.CreateWebApplication<Program>();
        await context.ContainerContext.StartPostgresAndApplyMigrationsAsync();

        var client = webApplication.CreateClient();
        var forecasts = await client.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
        forecasts.Should().NotBeNull();

        var appSettingsFromWebApplication = webApplication.Services.GetRequiredService<IAppSettings>();
        var connectionString = appSettingsFromWebApplication.GetRequiredConnectionString(nameof(QAContext));
        connectionString.Should().NotBeNull();

        var appSettingsFromTestContext = context.GetRequiredService<IAppSettings>();
        appSettingsFromWebApplication.Should().BeSameAs(appSettingsFromTestContext);//resolved from same service provider
    }

Data Attributes

DRN.Framework.Testing provides following data attributes that can provide data to tests:

  • DataInlineAttribute
  • DataMemberAttribute
  • DataSelfAttribute

Following design principle is used for these attributes

  • All attributes have data prefix to benefit from autocomplete
  • All data attributes automatically provide TestContext as first parameter if tests requires
  • All data attributes try to provide missing values with AutoFixture and NSubstitute
  • All data attributes will automatically override TestContext's service collection with provided NSubstitute interfaces
  • DataInline attribute works like xunit InlineData except they try to provide missing values with AutoFixture and NSubstitute
  • DataMember attribute works like xunit MemberData except they try to provide missing values with AutoFixture and NSubstitute
  • DateSelf attribute needs to be inherited by another class and should call AddRow method in constructor to provide data

Example usages for DataMember attribute

[Theory]
[DataMember(nameof(TestContextInlineMemberData))]
public void TestContextMember_Should_Inline_And_Auto_Generate_Missing_Test_Data(TestContext testContext,
    int inline, ComplexInline complexInline, Guid autoGenerate, IMockable mock)
{
    testContext.Should().NotBeNull();
    testContext.TestMethod.Name.Should().Be(nameof(TestContextMember_Should_Inline_And_Auto_Generate_Missing_Test_Data));
    inline.Should().BeGreaterThan(10);
    complexInline.Count.Should().BeLessThan(10);
    autoGenerate.Should().NotBeEmpty();
    mock.Max.Returns(75);
    mock.Max.Should().Be(75);
}

public static IEnumerable<object[]> TestContextInlineMemberData => new List<object[]>
{
    new object[] { 11, new ComplexInline(8) },
    new object[] { int.MaxValue, new ComplexInline(-1) }
};

Example usage for DataSelf attribute

public class DataSelfContextAttributeTests
{
    [Theory]
    [DataSelfContextTestData]
    public void TestContextClassData_Should_Inline_And_Auto_Generate_Missing_Test_Data(TestContext testContext,
        int inline, ComplexInline complexInline, Guid autoGenerate, IMockable mock)
    {
        testContext.Should().NotBeNull();
        testContext.TestMethod.Name.Should().Be(nameof(TestContextClassData_Should_Inline_And_Auto_Generate_Missing_Test_Data));
        inline.Should().BeGreaterThan(98);
        complexInline.Count.Should().BeLessThan(1001);
        autoGenerate.Should().NotBeEmpty();
        mock.Max.Returns(44);
        mock.Max.Should().Be(44);
    }
}

public class DataSelfContextTestData : DataSelfContextAttribute
{
    public DataSelfContextTestData1()
    {
        AddRow(99,new ComplexInline(100));
        AddRow(199,new ComplexInline(1000));
    }
}

Example usage for DataInline attribute

[Theory]
[DataInline(99)]
public void TextContext_Should_Be_Created_From_TestContextData(TestContext context, int inlineData, Guid autoInlinedData, IMockable autoInlinedMockable)
{
    inlineData.Should().Be(99);
    autoInlinedData.Should().NotBeEmpty(); //guid generated by AutoFixture
    autoInlinedMockable.Max.Returns(int.MaxValue); //dependency mocked by NSubstitute

    context.ServiceCollection.AddApplicationServices(); //you can add services, modules defined in hosted app, application, infrastructure layer etc..
    var serviceProvider = context.BuildServiceProvider(); //appsettings.json added by convention. Context and service provider will be disposed by xunit
    serviceProvider.GetService<ToBeRemovedService>().Should().BeNull(); //Service provider behaviour demonstration

    var dependentService = serviceProvider.GetRequiredService<DependentService>();
    dependentService.Max.Should().Be(int.MaxValue);
}

DebugOnly Tests

Following attributes can be used to run test only when the debugger is attached. These attributes does respect the attached debugger, not debug or release configuration.

  • FactDebuggerOnly
  • TheoryDebuggerOnly

Providers

SettingsProvider

SettingsProvider gets the settings from Settings folder. Settings file path is relative Settings folder. Settings folder must be created in the root of the test Project. Make sure the settings file is copied to output directory.

    [Fact]
    public void SettingsProvider_Should_Return_IAppSettings_Instance()
    {
        var appSettings = SettingsProvider.GetAppSettings();

        appSettings.GetRequiredSection("AllowedHosts").Value.Should().Be("*");
        appSettings.TryGetSection("Bar", out _).Should().BeTrue();
        appSettings.TryGetSection("Foo", out _).Should().BeFalse();
        appSettings.GetRequiredConnectionString("Foo").Should().Be("Bar");
        appSettings.TryGetConnectionString("Bar", out _).Should().BeFalse();
    }

    [Fact]
    public void SettingsProvider_Should_Return_IConfiguration_Instance()
    {
        var configuration = SettingsProvider.GetConfiguration("secondaryAppSettings");

        configuration.GetRequiredSection("AllowedHosts").Value.Should().Be("*");
        configuration.GetSection("Foo").Exists().Should().BeTrue();
        configuration.GetSection("Bar").Exists().Should().BeFalse();
        configuration.GetConnectionString("Bar").Should().Be("Foo");
    }

DataProvider

DataProvider gets the content of specified data file in the Data folder. Data file path is relative Data folder including file extension. Data folder must be created in the root of the test Project. Make sure the data file is copied to output directory.

    [Fact]
    public void DataProvider_Should_Return_Data_From_Test_File()
    {
        DataProvider.Get("Test.txt").Should().Be("Foo");
    }

Global Usings

Following global usings can be used in a Usings.cs file in test projects to reduce line of code in test files

global using Xunit;
global using AutoFixture;
global using AutoFixture.AutoNSubstitute;
global using AutoFixture.Xunit2;
global using DRN.Framework.Utils.Extensions;
global using DRN.Framework.SharedKernel;
global using DRN.Framework.Utils.Settings;
global using DRN.Framework.Utils.DependencyInjection;
global using DRN.Framework.Testing;
global using DRN.Framework.Testing.DataAttributes;
global using DRN.Framework.Testing.Providers;
global using DRN.Framework.Testing.TestAttributes;
global using DRN.Framework.Testing.Contexts;
global using FluentAssertions;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.DependencyInjection.Extensions;
global using Microsoft.Extensions.Configuration;
global using NSubstitute;
global using System.Reflection;
global using System.IO;
global using System.Linq;
global using System.Collections;

Example Test Project .csproj File

Don't forget to replace DRN.Framework.Testing project reference with its nuget package reference

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>net7.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <IsPackable>false</IsPackable>
        <IsTestProject>true</IsTestProject>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2"/>
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\DRN.Framework.Testing\DRN.Framework.Testing.csproj"/>
    </ItemGroup>

    <ItemGroup>
        <None Update="Settings\defaultAppSettings.json">
            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </None>
        <None Update="Data\Test.txt">
            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </None>
        <None Update="Settings\secondaryAppSettings.json">
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </None>
    </ItemGroup>

</Project>

Test snippet

dtt snippet for creating tests with a test context.

[Theory]
[DataInline]
public async Task $name$(TestContext context)
{
    $END$
}

Testing guide and DTT approach

DTT(Duran's Testing Technique) is developed upon following 2 idea to make testing natural part of the software development:

  • Writing a unit or integration test, providing settings and data to it should be easy, effective and encouraging as much as possible
  • A test should test actual usage as much as possible.

DTT with TestContext makes these ideas possible by

  • being aware of test data and location
  • effortlessly providing test data and settings
  • effortlessly providing service collection
  • effortlessly providing service provider
  • effortlessly validating service provider
  • effortlessly wiring external dependencies with Container Context
  • effortlessly wiring application with Application Context s With the help of test context, integration tests can be written easily with following styles.
  1. A data context attribute can provide NSubstituted interfaces and test context automatically replaces actual implementations with mocked interfaces and provides test data.
  2. Test containers can be used as actual dependencies instead of mocking them.
  3. With FactDebuggerOnly and TheoryDebuggerOnly attributes, cautiously written tests can use real databases and dependencies to debug production usage.

With DTT, software testing becomes natural part of the software development.


Semper Progredi: Always Progressive

Commit Info

Author: Duran Serkan KILIÇ
Date: 2024-11-10 19:48:40 +0300
Hash: fe1e1c0bfc19e4c8b4586b78a0f81eca604bba1b

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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0-preview055 254 12/16/2025
0.7.0-preview054 157 12/13/2025
0.7.0-preview053 107 12/12/2025
0.7.0-preview052 419 12/9/2025
0.7.0-preview051 279 12/7/2025
0.7.0-preview050 194 12/7/2025
0.7.0-preview049 169 11/26/2025
0.7.0-preview048 178 11/24/2025
0.7.0-preview047 125 11/7/2025
0.7.0-preview046 181 11/6/2025
0.7.0-preview045 180 11/3/2025
0.7.0-preview044 188 11/2/2025
0.7.0-preview043 127 11/1/2025
0.7.0-preview042 190 10/29/2025
0.7.0-preview041 105 10/25/2025
0.7.0-preview040 162 10/12/2025
0.7.0-preview039 114 10/11/2025
0.7.0-preview038 180 10/8/2025
0.7.0-preview037 180 9/28/2025
0.7.0-preview036 191 9/22/2025
0.7.0-preview035 179 8/31/2025
0.7.0-preview034 189 8/31/2025
0.7.0-preview033 222 8/28/2025
0.7.0-preview032 229 8/27/2025
0.7.0-preview031 181 8/10/2025
0.7.0-preview030 67 8/1/2025
0.7.0-preview029 98 8/1/2025
0.7.0-preview028 96 8/1/2025
0.7.0-preview027 128 7/31/2025
0.7.0-preview026 124 7/29/2025
0.7.0-preview025 134 7/27/2025
0.7.0-preview024 106 7/11/2025
0.7.0-preview023 121 7/11/2025
0.7.0-preview022 172 6/29/2025
0.7.0-preview021 177 6/23/2025
0.7.0-preview020 130 5/31/2025
0.7.0-preview019 197 3/23/2025
0.7.0-preview018 134 3/2/2025
0.7.0-preview017 149 2/23/2025
0.7.0-preview016 170 2/22/2025
0.7.0-preview015 122 2/21/2025
0.7.0-preview014 174 2/20/2025
0.7.0-preview013 146 2/9/2025
0.7.0-preview012 143 2/8/2025
0.7.0-preview011 139 2/2/2025
0.7.0-preview010 139 1/20/2025
0.7.0-preview009 108 1/19/2025
0.7.0-preview008 109 1/16/2025
0.7.0-preview007 121 12/29/2024
0.7.0-preview006 122 12/23/2024
0.7.0-preview005 145 11/27/2024
0.7.0-preview004 116 11/23/2024
0.7.0-preview003 115 11/20/2024
0.7.0-preview002 113 11/17/2024
0.7.0-preview001 137 11/14/2024
0.6.0 195 11/10/2024
0.6.0-preview002 126 11/10/2024
0.6.0-preview001 136 11/10/2024
0.5.1-preview002 127 9/30/2024
0.5.1-preview001 133 9/22/2024
0.5.0 164 8/30/2024
0.5.0-preview011 143 8/30/2024
0.5.0-preview010 157 8/25/2024
0.5.0-preview009 163 8/8/2024
0.5.0-preview008 131 8/7/2024
0.5.0-preview007 129 8/2/2024
0.5.0-preview006 110 7/30/2024
0.5.0-preview005 133 7/27/2024
0.5.0-preview004 141 7/15/2024
0.5.0-preview003 151 6/6/2024
0.5.0-preview002 139 6/5/2024
0.5.0-preview001 174 6/4/2024
0.4.0 146 5/19/2024
0.4.0-preview006 132 5/19/2024
0.4.0-preview005 134 5/12/2024
0.4.0-preview004 146 5/12/2024
0.4.0-preview003 149 5/11/2024
0.4.0-preview002 160 5/8/2024
0.4.0-preview001 185 5/5/2024
0.3.1-preview001 146 4/26/2024
0.3.0 192 4/23/2024
0.3.0-preview002 124 4/23/2024
0.3.0-preview001 135 4/23/2024
0.2.2-preview010 169 4/11/2024
0.2.2-preview009 151 3/18/2024
0.2.2-preview008 158 3/18/2024
0.2.2-preview007 177 3/16/2024
0.2.2-preview006 138 3/11/2024
0.2.2-preview005 134 3/10/2024
0.2.2-preview004 139 3/10/2024
0.2.2-preview003 182 1/22/2024
0.2.2-preview002 152 1/18/2024
0.2.2-preview001 163 1/14/2024
0.2.1 260 1/7/2024
0.2.0 206 12/31/2023
0.2.0-preview009 171 12/31/2023
0.2.0-preview008 169 12/30/2023
0.2.0-preview007 177 12/28/2023
0.2.0-preview006 153 12/27/2023
0.2.0-preview005 155 12/25/2023
0.2.0-preview004 155 12/23/2023
0.2.0-preview003 175 12/20/2023
0.2.0-preview002 186 12/19/2023
0.2.0-preview001 172 12/18/2023
0.1.0 236 11/26/2023
0.1.0-preview013 174 11/26/2023
0.1.0-preview012 144 11/20/2023
0.1.0-preview011 159 11/19/2023
0.1.0-preview010 224 10/30/2023
0.1.0-preview009 156 10/29/2023
0.1.0-preview008 163 10/27/2023
0.1.0-preview007 159 10/11/2023
0.1.0-preview006 159 10/9/2023
0.1.0-preview005 171 10/8/2023
0.1.0-preview004 181 10/8/2023
0.1.0-preview003 176 10/3/2023
0.1.0-preview002 181 10/3/2023
0.1.0-preview001 178 10/2/2023

Not every version includes changes, features or bug fixes. This project can increment version to keep consistency with other DRN.Framework projects.

## Version 0.6.0

My family celebrates the enduring legacy of Mustafa Kemal Atatürk's enlightenment ideals. This release is dedicated to the memory of Mustafa Kemal Atatürk, founder of the Republic of Türkiye, and to his vision for a modern, enlightened, democratic nation. In his eternal rest, he continues to guide us through his ideals of freedom, progress, and national sovereignty.

### New Features

* CredentialsProvider added
* ApplicationContext async methods names changed with async suffixes
* StartupContext can create new TestContexts with CreateNewContext

## Version 0.5.0

My family celebrates the enduring legacy of Mustafa Kemal Atatürk's enlightenment ideals. This release is dedicated to August 30 Victory Day, a day that marks the decisive victory achieved by the Turkish people against imperialism during the Turkish War of Independence, leading to the establishment of the Republic of Türkiye.

### New Features

* ITestStartupJob interface - added to run startup tasks before any TestContext is created.
 * PostgresContainerSettings or RabbitMQContainerSettings can be updated in a job that implements ITestStartupJob in the test project
* TestContext
 * FlurlHttpTest property to mock http requests
 * GetSettingsData
 * GetSettingsPath
* ContainerContext
 * BindExternalDependenciesAsync
 * PostgresContext
   * static PostgresContainerSettings property - added to provide PostgresContext defaults
 * RabbitMQContext
   * static RabbitMQContainerSettings property - added to provide RabbitMQContext defaults
* ApplicationContext
 * CreateApplicationAndBindDependencies - added with Most used defaults and bindings
 * CreateClientAsync - added with most used defaults and bindings
 * GetCreatedApplication - added to get already application
 * LogToTestOutput - added to get application logs with ITestOutputHelper
* DataProvider - added GetDataPath
* SettingsProvider - added GetSettingsPath and GetSettingsData

### Breaking Changes

* ContainerContext
 * PostgresContext
   * BuildContainer parameters are refactored into PostgresContainerSettings with Image Tag and Version settings
 * RabbitMQContext
   * BuildContainer parameters are refactored into RabbitMQContainerSettings with Image Tag and Version settings
* DataProvider
 * Get - returns DataProviderResult instead of string value
* LaunchExternalDependenciesAsync - IScopedLog and IAppsettings parameters refactored

## Version 0.4.0

My family celebrates the enduring legacy of Mustafa Kemal Atatürk's enlightenment ideals. This release is dedicated to 19 May Commemoration of Atatürk, Youth and Sports Day.

### New Features

* LaunchExternalDependenciesAsync extension method is added on WebApplicationBuilder to launch application all of its dependencies
 * DrnAppFeatures:LaunchExternalDependencies config should set true and Environment should be Development
* ApplicationContext.LogToTestOutput method added to configure TestOutput as serilog sink

## Version 0.3.0

My family celebrates the enduring legacy of Mustafa Kemal Atatürk's enlightenment ideals. This release is dedicated to 23 April ~~National Sovereignty and Children's Day~~.

### Breaking Changes

* ContainerContext - refactored and each Postgres and RabbitMQ usages refactored into PostgresContext and RabbitMQContext.
* WebApplicationContext - renamed as ApplicationContext

### New Features

* PostgresContext and RabbitMQContext's now have global instances and isolated contexts
* ApplicationContext's LogToTestOutput method redirects application logs to test output when ITestOutputHelper is provided

### Bug Fixes

* Postgres container doesn't respect custom options

## Version 0.2.0

### Breaking Changes

* Data context and auto attributes unified into:
 * DataInlineAttribute
 * DataMemberAttribute
 * DataSelfAttribute
* Old data attributes removed.

### New Features

* TestContext exposes AddToConfiguration to add poco objects to configuration root with System.Text.Json.
* TestContext exposes BuildConfigurationRoot method.
* TestContext exposes GetConfigurationDebugView method.
* TestContext exposes ContainerContext and WebApplicationContext.
* FactDebuggerOnly and TheoryDebuggerOnly test attributes
* Following data attributes added:
 * DataInlineAttribute
 * DataMemberAttribute
 * DataSelfAttribute
* If TestContext is first parameter of the test method, data attributes will automatically detect and provide it.

## Version 0.1.0

### New Features

* TestContext
* FactDebuggerOnly and TheoryDebuggerOnly test attributes
* Following data attributes added:
 * DataInlineAutoAttribute
 * DataInlineContextAttribute
 * DataMemberAutoAttribute
 * DataMemberContextAttribute
 * DataSelfAutoAttribute
 * DataSelfContextAttribute
* SettingsProvider
* DataProvider

---

**Semper Progredi: Always Progressive**  
 
## Commit Info  
Author: Duran Serkan KILIÇ  
Date: 2024-11-10 19:48:40 +0300  
Hash: fe1e1c0bfc19e4c8b4586b78a0f81eca604bba1b