public XmlSerializationManager(IReferencesResolver referenceResolver,
                                IContainer container, IObjectConverterFinder objectConverterFinder, ISimulationUpdaterAfterDeserialization simulationUpdater,
                                IEventPublisher eventPublisher, ISerializationContextFactory serializationContextFactory)
 {
     _referenceResolver           = referenceResolver;
     _objectConverterFinder       = objectConverterFinder;
     _simulationUpdater           = simulationUpdater;
     _eventPublisher              = eventPublisher;
     _serializationContextFactory = serializationContextFactory;
     _container = container;
 }
Example #2
0
 public ObserverLoader(
     IOSPSuiteXmlSerializerRepository modellingXmlSerializerRepository,
     IObjectConverterFinder objectConverterFinder,
     IDimensionFactory dimensionFactory,
     IObjectBaseFactory objectBaseFactory,
     ICloneManagerForModel cloneManagerForModel
     )
 {
     _objectConverterFinder            = objectConverterFinder;
     _dimensionFactory                 = dimensionFactory;
     _objectBaseFactory                = objectBaseFactory;
     _cloneManagerForModel             = cloneManagerForModel;
     _modellingXmlSerializerRepository = modellingXmlSerializerRepository;
     _containerObserverSerializer      = modellingXmlSerializerRepository.SerializerFor <ContainerObserverBuilder>();
     _amountObserverSerializer         = modellingXmlSerializerRepository.SerializerFor <AmountObserverBuilder>();
 }
Example #3
0
 public PKMLPersistor(
     IOSPSuiteXmlSerializerRepository serializerRepository,
     IContainer container,
     IReferencesResolver referencesResolver,
     IObjectConverterFinder objectConverterFinder,
     IDimensionFactory dimensionFactory,
     IObjectBaseFactory objectBaseFactory,
     ICloneManagerForModel cloneManagerForModel)
 {
     _serializerRepository  = serializerRepository;
     _container             = container;
     _referencesResolver    = referencesResolver;
     _objectConverterFinder = objectConverterFinder;
     _dimensionFactory      = dimensionFactory;
     _objectBaseFactory     = objectBaseFactory;
     _cloneManagerForModel  = cloneManagerForModel;
 }
Example #4
0
        protected override void Context()
        {
            _individual = new Individual();
            _container  = A.Fake <IContainer>();
            _serializationContextFactory = A.Fake <ISerializationContextFactory>();
            _simulationUpdater           = A.Fake <ISimulationUpdaterAfterDeserialization>();
            _eventPublisher        = A.Fake <IEventPublisher>();
            _xmlReaderIndividual   = A.Fake <IXmlReader <Individual> >();
            _xmlWriterIndividual   = A.Fake <IXmlWriter <Individual> >();
            _xmlReaderSimulation   = A.Fake <IXmlReader <Simulation> >();
            _xmlWriterSimulation   = A.Fake <IXmlWriter <Simulation> >();
            _objectConverterFinder = A.Fake <IObjectConverterFinder>();
            _serializationContext  = A.Fake <SerializationContext>();
            A.CallTo(() => _container.Resolve <IXmlReader <Individual> >()).Returns(_xmlReaderIndividual);
            A.CallTo(() => _container.Resolve <IXmlWriter <Individual> >()).Returns(_xmlWriterIndividual);
            A.CallTo(() => _container.Resolve <IXmlReader <Simulation> >()).Returns(_xmlReaderSimulation);
            A.CallTo(() => _container.Resolve <IXmlWriter <Simulation> >()).Returns(_xmlWriterSimulation);

            _referenceResolver = A.Fake <IReferencesResolver>();
            sut = new XmlSerializationManager(_referenceResolver, _container, _objectConverterFinder, _simulationUpdater, _eventPublisher, _serializationContextFactory);
            A.CallTo(() => _serializationContextFactory.Create(null, null)).Returns(_serializationContext);
        }
 public SimulationPersistor(IOSPSuiteXmlSerializerRepository modellingXmlSerializerRepository, IObjectConverterFinder objectConverterFinder, IReferencesResolver refResolver)
 {
     _modellingXmlSerializerRepository = modellingXmlSerializerRepository;
     _objectConverterFinder            = objectConverterFinder;
     _refResolver = refResolver;
 }