protected override void Context()
        {
            base.Context();
            _context = A.Fake <IMoBiContext>();
            A.CallTo(() => _context.Get <ISimulationSettings>(A <string> ._)).Returns(_buildingBlock);

            var serialStream = new byte[0];

            A.CallTo(() => _context.Serialize(_chartTemplate)).Returns(serialStream);
            A.CallTo(() => _context.Deserialize <CurveChartTemplate>(serialStream)).Returns(new CurveChartTemplate().WithName(_chartTemplate.Name));
        }
        protected override void Context()
        {
            _context       = A.Fake <IMoBiContext>();
            _buildingBlock = new ParameterStartValuesBuildingBlock();

            _psv = new ParameterStartValue {
                Path = new ObjectPath("path1"), StartValue = -1, DisplayUnit = new Unit("Dimensionless", 1.0, 1)
            };
            _buildingBlock.Add(_psv);
            sut = new RemoveParameterStartValueFromBuildingBlockCommand(_buildingBlock, _psv.Path);

            A.CallTo(() => _context.Deserialize <IParameterStartValue>(A <byte[]> ._)).Returns(_psv);
            A.CallTo(() => _context.Get <IStartValuesBuildingBlock <IParameterStartValue> >(_buildingBlock.Id)).Returns(_buildingBlock);
        }
 public override void RestoreExecutionData(IMoBiContext context)
 {
     base.RestoreExecutionData(context);
     _startValue = context.Deserialize <T>(_serializedParameterStartValue);
 }
 public override void RestoreExecutionData(IMoBiContext context)
 {
     _simulation = context.Deserialize <IMoBiSimulation>(_serializationStream);
 }
Ejemplo n.º 5
0
 public override void RestoreExecutionData(IMoBiContext context)
 {
     _simulationToUpdate        = context.Get <IMoBiSimulation>(_simulationId);
     _newModel                  = context.Deserialize <IModel>(_modelSerialization);
     _updatedBuildConfiguration = context.Deserialize <IMoBiBuildConfiguration>(_buildConfigurationSerialization);
 }
 public override void RestoreExecutionData(IMoBiContext context)
 {
     base.RestoreExecutionData(context);
     _chartTemplate = context.Deserialize <CurveChartTemplate>(_serializationStream);
 }
Ejemplo n.º 7
0
 public override void RestoreExecutionData(IMoBiContext context)
 {
     _buildingBlock = context.Deserialize <T>(_serializationStream);
 }