Skip to content

fluentassertions/fluentassertions.ioc.ninject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9e7a581 · Mar 29, 2020

History

63 Commits
Mar 20, 2020
Mar 29, 2020
Mar 20, 2020
Dec 11, 2014
Mar 20, 2020
Jun 24, 2014
Jun 24, 2014
Oct 24, 2017
Mar 25, 2020
Jun 24, 2014

Repository files navigation

Fluent Assertions for Ninject

Build status

This repro contains the Fluent Assertions extensions for Ninject. It is maintained by @kevinkuszyk.

Why?

To test Ninject mappings using the conventions extension (or setup manually) are resolving. Instead of finding out at runtime that your app won't run, you'll have a failing unit test instead.

Tests are written like this:

[Test]
public void Services_can_be_resolved_with_a_single_instance()
{
    // Arrange
    var kernel = GetKernel();
    var interfaces = FindAssembly.Containing<ISampleService>().GetPublicInterfaces()
                                                              .EndingWith("Service");

    // Assert
    kernel.Should().Resolve(interfaces).WithSingleInstance();
}

Installing

Please install the NuGet package:

PM> Install-Package FluentAssertions.Ioc.Ninject

Documentation

Please see the sample tests

Building

Simply clone this repro and build the FluentAssertions.Ioc.Ninject.sln solution.