Skip to content

Test (and possibly fix/add error messaging around) conflicting dependencies and multiple constructors #94

@PandaMagnus

Description

@PandaMagnus

Example:

Class 1 asks for:

public class SomeClass
{
   public SomeClass(int someInt) { // do stuff }
   public SomeClass(string someString) { // do stuff }
}

And the DI setup looks like:

TestBuilder
   .AddDependencyInstance(10)
   .AddDependencyInstance("hello!")

This appears to be a silent failure (real world use case used factory pattern AddDependencyService(Func<,>) which may matter.) This should throw a helpful error that you cannot do this.

Assess if this should be an error on .Build() instead of during a test run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions