fm.Extensions.Testing.DependencyInjection 4.0.0

Provides a base class for tests based on Microsoft.Extensions.DependencyInjection. Use common Startup.cs patterns like ConfigureServices(...) and Configure(...) to setup your tests.

Commonly used types:
ServiceTestsBase

Example:
[TestClass]
public class MyServiceTests : ServiceTestsBase
{
   protected override void ConfigureConfiguration([NotNull] IConfigurationBuilder configuration)
   {
       base.ConfigureConfiguration(configuration);
       // Add your own configuration providers here
   }

   protected override void ConfigureLogging([NotNull] ILoggingBuilder builder)
   {
       base.ConfigureLogging(builder);
       // Add your own logging providers here
   }

   protected override void ConfigureServices([NotNull] IServiceCollection services)
   {
       base.ConfigureServices(services);
       // Add your own services here
       // services.AddSingleton<IMyService, MyService>();
   }

   protected override void Configure([NotNull] IServiceProvider services)
   {
       base.Configure(services);
       // Do your own configuration here
   }

   [TestMethod]
   public void MyServiceTest()
   {
       // IMyService myService = this.GetRequiredService<IMyService>();
       // TODO: Do testing on your service

       // Or use any of the following properties this.Configuration, this.Log, this.Services
   }
}

There is a newer version of this package available.
See the version list below for details.
Install-Package fm.Extensions.Testing.DependencyInjection -Version 4.0.0
dotnet add package fm.Extensions.Testing.DependencyInjection --version 4.0.0
<PackageReference Include="fm.Extensions.Testing.DependencyInjection" Version="4.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add fm.Extensions.Testing.DependencyInjection --version 4.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

Upgrade to logging 2.0 (Adding ConfigureLogging())

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
4.3.0 47 10/23/2019
4.2.1 155 2/26/2019
4.2.0 120 2/26/2019
4.0.0 3,957 10/11/2017
3.0.0 213 10/9/2017
2.0.0 434 2/27/2017
1.0.0 469 6/29/2016