Esempio n. 1
0
        public void DoesNotContains_ShouldReturnTrueWhenContainerIsNullForAnyType()
        {
            // Arrange
            IObjectContainer container = null;
            var anyType = GetType();

            // Act & Assert
            container.DoesNotContains(anyType).Should().BeTrue();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public static bool DoesNotContains(this IObjectContainer container, object instance)
 {
     return(instance == null || container.DoesNotContains(instance.GetType()));
 }