public void DoesNotContains_ShouldReturnTrueWhenContainerIsNullForAnyType() { // Arrange IObjectContainer container = null; var anyType = GetType(); // Act & Assert container.DoesNotContains(anyType).Should().BeTrue(); }
private static void RegisterInstance(this IObjectContainer container, object instance, Type type) { if (container == null || type.IsNotSubClassOrSameAs(instance)) { return; } if (container.DoesNotContains(type)) { container.RegisterInstanceAs(instance, type); } container.RegisterInstance(instance, type.BaseType); }
public static bool DoesNotContains(this IObjectContainer container, object instance) { return(instance == null || container.DoesNotContains(instance.GetType())); }