Exemple #1
0
        public ActionSpec(SpecFactory memberFactory,
                          IMetamodelManager metamodel,
                          ILifecycleManager lifecycleManager,
                          ISession session,
                          IServicesManager servicesManager,
                          INakedObjectManager nakedObjectManager,
                          IActionSpecImmutable actionSpecImmutable,
                          IMessageBroker messageBroker,
                          ITransactionManager transactionManager,
                          IObjectPersistor persistor,
                          ILoggerFactory loggerFactory,
                          ILogger <ActionSpec> logger)
            : base(actionSpecImmutable?.Identifier?.MemberName, actionSpecImmutable, session, lifecycleManager, metamodel, persistor)
        {
            this.servicesManager     = servicesManager ?? throw new InitialisationException($"{nameof(servicesManager)} is null");
            this.nakedObjectManager  = nakedObjectManager ?? throw new InitialisationException($"{nameof(nakedObjectManager)} is null");
            this.actionSpecImmutable = actionSpecImmutable ?? throw new InitialisationException($"{nameof(actionSpecImmutable)} is null");
            this.messageBroker       = messageBroker ?? throw new InitialisationException($"{nameof(messageBroker)} is null");
            this.transactionManager  = transactionManager ?? throw new InitialisationException($"{nameof(transactionManager)} is null");
            this.loggerFactory       = loggerFactory ?? throw new InitialisationException($"{nameof(loggerFactory)} is null");
            this.logger = logger ?? throw new InitialisationException($"{nameof(logger)} is null");
            var index = 0;

            Parameters = this.actionSpecImmutable.Parameters.Select(pp => memberFactory.CreateParameter(pp, this, index++)).ToArray();
        }
        public ActionSpec(INakedObjectsFramework framework,
                          SpecFactory memberFactory,

                          IActionSpecImmutable actionSpecImmutable,

                          ILoggerFactory loggerFactory,
                          ILogger <ActionSpec> logger)
            : base(actionSpecImmutable?.Identifier?.MemberName, actionSpecImmutable, framework)
        {
            this.framework           = framework ?? throw new InitialisationException($"{nameof(framework)} is null");
            this.actionSpecImmutable = actionSpecImmutable ?? throw new InitialisationException($"{nameof(actionSpecImmutable)} is null");
            this.loggerFactory       = loggerFactory ?? throw new InitialisationException($"{nameof(loggerFactory)} is null");
            this.logger = logger ?? throw new InitialisationException($"{nameof(logger)} is null");
            var index = 0;

            Parameters = this.actionSpecImmutable.Parameters.Select(pp => memberFactory.CreateParameter(pp, this, index++)).ToArray();
        }