Fixed tests
This commit is contained in:
Родитель
b23097ade8
Коммит
021c8c9c03
|
@ -27,28 +27,5 @@ namespace Injection.Optional
|
|||
Assert.IsNotNull(instance);
|
||||
Assert.AreEqual(expected, instance.Value);
|
||||
}
|
||||
|
||||
protected override void Assert_ThrowsWhenNotRegistered(Type type, InjectionMember member, object @default, object expected)
|
||||
{
|
||||
// Inject
|
||||
Container.RegisterType(null, type, null, null, member);
|
||||
|
||||
// Act
|
||||
var instance = Container.Resolve(type, null) as PatternBaseType;
|
||||
|
||||
// Validate
|
||||
Assert.IsNotNull(instance);
|
||||
Assert.AreEqual(@default, instance.Value);
|
||||
|
||||
// Register missing types
|
||||
RegisterTypes();
|
||||
|
||||
// Act
|
||||
instance = Container.Resolve(type, null) as PatternBaseType;
|
||||
|
||||
// Validate
|
||||
Assert.IsNotNull(instance);
|
||||
Assert.AreEqual(expected, instance.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,9 +42,8 @@ namespace Injection
|
|||
public virtual void Inject_WithType(string test, Type type, object defaultValue, object defaultAttr,
|
||||
object registered, object named, object injected, object overridden,
|
||||
object @default)
|
||||
=> Assert_ThrowsWhenNotRegistered(
|
||||
BaselineTestType.MakeGenericType(type),
|
||||
InjectionMember_Value(type), @default, registered);
|
||||
=> Assert_Injection(BaselineTestType.MakeGenericType(type),
|
||||
InjectionMember_Value(type), @default, registered);
|
||||
|
||||
#if BEHAVIOR_V4 || BEHAVIOR_V5
|
||||
[Ignore("https://github.com/unitycontainer/container/issues/235")]
|
||||
|
|
Загрузка…
Ссылка в новой задаче