Cortside.Common.Testing 6.2.408

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Cortside.Common.Testing --version 6.2.408
NuGet\Install-Package Cortside.Common.Testing -Version 6.2.408
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="Cortside.Common.Testing" Version="6.2.408" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cortside.Common.Testing --version 6.2.408
#r "nuget: Cortside.Common.Testing, 6.2.408"
#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.
// Install Cortside.Common.Testing as a Cake Addin
#addin nuget:?package=Cortside.Common.Testing&version=6.2.408

// Install Cortside.Common.Testing as a Cake Tool
#tool nuget:?package=Cortside.Common.Testing&version=6.2.408

Cortside.Common.Testing

  • Update nuget dependencies to latest stable versions
  • Add ScopedLocalTimeZone for use with tests to set predictable timezone regardless of environment
    using (new ScopedLocalTimeZone(TimeZoneInfo.FindSystemTimeZoneById("UTC+12"))) {
        var localDateTime = new DateTime(2020, 12, 31, 23, 59, 59, DateTimeKind.Local);
        var utcDateTime = TimeZoneInfo.ConvertTimeToUtc(localDateTime);
    
        Assert.Equal("UTC+12", TimeZoneInfo.Local.Id);
        Assert.Equal(utcDateTime.AddHours(12), localDateTime);
    }
    
  • Add XunitLogger for capturing log output to xUnit's ITestOutputHelper
    // Create a logger factory with a debug provider
    loggerFactory = LoggerFactory.Create(builder => {
        builder
            .SetMinimumLevel(LogLevel.Trace)
            .AddFilter("Microsoft", LogLevel.Warning)
            .AddFilter("System", LogLevel.Warning)
            .AddFilter("Cortside.Common", LogLevel.Trace)
            .AddXunit(output);
    });
    
    // Create a logger with the category name of the current class
    var logger = loggerFactory.CreateLogger<XunitLoggerTest>();
    
    ... user logger as you would any other logger ...
    
  • changed hierarchichal organization of loggers, so LogEventLogger has new namespace of Cortside.Common.Testing.Logging.LogEvent
  • Added helper class RandomValues for generating "random" data
  • Added IServiceCollection extension method Unregister<T> for unregistering something already in service collection
    // Remove the app's DbContext registration.
    services.Unregister<DbContextOptions<DatabaseContext>>();
    services.Unregister<DbContext>();
    
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Cortside.Common.Testing:

Package Downloads
Cortside.AspNetCore.Testing

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.3.413-develop 103 4/24/2024
6.3.412-develop 72 4/23/2024
6.3.411-develop 71 4/23/2024
6.3.410-develop 354 3/25/2024
6.3.401-develop 119 1/9/2024
6.2.408 631 1/16/2024
6.2.406 248 1/10/2024
6.2.403 162 1/9/2024
6.2.402-6.2 66 1/9/2024
6.2.400-6.2 61 1/9/2024
6.2.399-develop 115 12/22/2023
6.1.397 595 11/14/2023
6.1.393 73 11/10/2023
6.1.392 75 11/10/2023
6.1.390 132 11/8/2023
6.1.382-develop 70 11/8/2023
6.1.381-develop 83 11/1/2023
6.1.380-develop 110 10/16/2023
6.1.379-develop 155 9/12/2023