protected override async Task Context() { await base.Context(); _compoundCalculationMethod = new OSPSuite.Core.Domain.CalculationMethodCache(); _calculationMethodSnapshot = new CalculationMethodCache(); _categorialParameterIdentificationRunMode = new CategorialParameterIdentificationRunMode { AllTheSame = false }; _categorialParameterIdentificationRunMode.CalculationMethodsCache["C1"] = _compoundCalculationMethod; A.CallTo(() => _calculationMethodMapper.MapToSnapshot(_compoundCalculationMethod)).Returns(_calculationMethodSnapshot); }
private ModelParameterIdentificationRunMode categorialRunModeFrom(SnapshotParameterIdentificationRunMode snapshot) { var runMode = new CategorialParameterIdentificationRunMode { AllTheSame = false }; foreach (var kv in snapshot.CalculationMethods) { var calculationMethodCache = new OSPSuite.Core.Domain.CalculationMethodCache(); updateCalculationMethodCache(calculationMethodCache, kv.Value); runMode.CalculationMethodsCache[kv.Key] = calculationMethodCache; } return(runMode); }
private void updateCalculationMethodCache(OSPSuite.Core.Domain.CalculationMethodCache modelCalculationMethodCache, CalculationMethodCache snapshotCalculationMethodCache) { _calculationMethodCacheMapper.UpdateCalculationMethodCache(modelCalculationMethodCache, snapshotCalculationMethodCache, oneCalculationMethodPerCategory: false); }