Пример #1
0
        /// <summary>
        /// Creates a new instance of <see cref="StochasticSoilModelImporterConfiguration{T}"/>.
        /// </summary>
        /// <param name="transformer">The transformer to use in this configuration.</param>
        /// <param name="mechanismFilter">The failure mechanism filter.</param>
        /// <param name="updateStrategy">The strategy to use in this configuration.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="transformer"/>
        /// or <paramref name="updateStrategy"/> is <c>null</c>.</exception>
        public StochasticSoilModelImporterConfiguration(IStochasticSoilModelTransformer <T> transformer,
                                                        IStochasticSoilModelMechanismFilter mechanismFilter,
                                                        IStochasticSoilModelUpdateModelStrategy <T> updateStrategy)
        {
            if (transformer == null)
            {
                throw new ArgumentNullException(nameof(transformer));
            }

            if (mechanismFilter == null)
            {
                throw new ArgumentNullException(nameof(mechanismFilter));
            }

            if (updateStrategy == null)
            {
                throw new ArgumentNullException(nameof(updateStrategy));
            }

            Transformer     = transformer;
            MechanismFilter = mechanismFilter;
            UpdateStrategy  = updateStrategy;
        }
        /// <summary>
        /// Creates a new instance of <see cref="StochasticSoilModelImporter{T}"/>.
        /// </summary>
        /// <param name="importTarget">The import target.</param>
        /// <param name="filePath">The path to the file to import from.</param>
        /// <param name="messageProvider">The message provider to provide messages during importer
        /// actions.</param>
        /// <param name="configuration">The mechanism specific configuration containing all
        /// necessary stochastic soil model components.</param>
        /// <exception cref="ArgumentNullException">Thrown when any of the input parameters is <c>null</c>.</exception>
        public StochasticSoilModelImporter(
            ObservableUniqueItemCollectionWithSourcePath <T> importTarget,
            string filePath,
            IImporterMessageProvider messageProvider,
            StochasticSoilModelImporterConfiguration <T> configuration)
            : base(filePath, importTarget)
        {
            if (messageProvider == null)
            {
                throw new ArgumentNullException(nameof(messageProvider));
            }

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            this.messageProvider = messageProvider;
            updateStrategy       = configuration.UpdateStrategy;
            transformer          = configuration.Transformer;
            filter = configuration.MechanismFilter;

            updatedInstances = Enumerable.Empty <IObservable>();
        }
Пример #3
0
 public void Setup()
 {
     mocks       = new MockRepository();
     transformer = mocks.Stub <IStochasticSoilModelTransformer <IMechanismStochasticSoilModel> >();
 }