internal SafeContainer( ITypeIdGenerator typeIdGenerator, IInstanceProviderFactory instanceFactory, IInstanceValidator instanceValidator, ISafeObjectFactory safeObjectFactory, SafeContainerProtectionMode protectionMode = Defaults.ContainerProtectionMode, InjectionAlertChannel alertChannel = Defaults.AlertChannel) : base(protectionMode) { if (typeIdGenerator == null) { throw new ArgumentNullException(nameof(typeIdGenerator)); } if (instanceFactory == null) { throw new ArgumentNullException(nameof(instanceFactory)); } if (instanceValidator == null) { throw new ArgumentNullException(nameof(instanceValidator)); } if (safeObjectFactory == null) { throw new ArgumentNullException(nameof(safeObjectFactory)); } _typeIdGenerator = typeIdGenerator; _instanceFactory = instanceFactory; _instanceValidator = instanceValidator; _safeObjectFactory = safeObjectFactory; _alertChannel = alertChannel; ChangeProtectionMode(new ProtectionChangeContext <SafeContainerProtectionMode>(protectionMode)); SetAlertChannelInternal(alertChannel); }
private static ISafeContainer GetSut( SafeContainerProtectionMode protectionMode = SafeContainerProtectionMode.FullProtection , IInstanceProviderFactory providerFactory = null, IInstanceValidator instanceValidator = null, ISafeObjectFactory safeObjectFactory = null, InjectionAlertChannel alertChannel = Defaults.AlertChannel ) { return(new SafeContainer( Stubs.Get <ITypeIdGenerator>(), providerFactory ?? Stubs.Get <IInstanceProviderFactory>(), instanceValidator ?? Stubs.Get <IInstanceValidator>(), safeObjectFactory ?? Stubs.Get <ISafeObjectFactory>(), protectionMode, alertChannel )); }