protected override void Context() { base.Context(); _project = new MoBiProject(); var molecule = new MoleculeBuilder().WithName(_moleculeName); var moleculeParameter = new Parameter().WithName(_moleculeParameterName); molecule.Add(moleculeParameter); var molecules = new MoleculeBuildingBlock() { molecule }; _project.AddBuildingBlock(molecules); var parameter = new Parameter().WithName(_parameterName); var root = new Container().WithName("Root"); root.Add(parameter); var spatialStructure = new MoBiSpatialStructure().WithTopContainer(root); _project.AddBuildingBlock(spatialStructure); var reactionBuilder = new ReactionBuilder().WithName(_reactionName); var reactions = new MoBiReactionBuildingBlock() { reactionBuilder }; _project.AddBuildingBlock(reactions); A.CallTo(() => _context.CurrentProject).Returns(_project); }
protected override void Context() { base.Context(); _buildConfiguration = A.Fake <IMoBiBuildConfiguration>(); _psvInfo = new ParameterStartValuesBuildingBlockInfo { UntypedBuildingBlock = new ParameterStartValuesBuildingBlock().WithId("psvbb1") }; _templateMoleculeBuildingBlock = new MoleculeBuildingBlock { Id = "templateMoleculeBuildingBlock" }; _templateSpatialStructure = new MoBiSpatialStructure() { Id = "templateSpatialStructure" }; _moleculesInfo = new MoleculesInfo { UntypedBuildingBlock = _templateMoleculeBuildingBlock }; _spatialStructureInfo = new SpatialStructureInfo { UntypedBuildingBlock = _templateSpatialStructure }; _buildConfiguration.ParameterStartValuesInfo = _psvInfo; _buildConfiguration.SpatialStructureInfo = _spatialStructureInfo; _buildConfiguration.MoleculesInfo = _moleculesInfo; A.CallTo(() => _buildConfiguration.AllBuildingBlockInfos()).Returns(new IBuildingBlockInfo[] { _psvInfo, _moleculesInfo, _spatialStructureInfo }); _cloneBuildingBlock = new ParameterStartValuesBuildingBlock().WithId("psvbb2"); A.CallTo(() => _cloneManager.CloneBuidingBlock(_psvInfo.BuildingBlock)).Returns(_cloneBuildingBlock); A.CallTo(() => _simulation.MoBiBuildConfiguration).Returns(_buildConfiguration); A.CallTo(_nameCorrector).WithReturnType <bool>().Returns(true); }
protected override void Context() { base.Context(); _project = new MoBiProject(); var molecule = new MoleculeBuilder().WithName(_moleculeName); var moleculeParameter = new Parameter().WithName(_moleculeParameterName); molecule.Add(moleculeParameter); var molecules = new MoleculeBuildingBlock() { molecule }; _project.AddBuildingBlock(molecules); var parameter = new Parameter().WithName(_parameterName); var root = new Container().WithName(_topContainerName); root.Add(parameter); var spatialStructure = new MoBiSpatialStructure().WithTopContainer(root); spatialStructure.GlobalMoleculeDependentProperties = new Container().WithName(Constants.MOLECULE_PROPERTIES); spatialStructure.NeighborhoodsContainer = new Container().WithName(Constants.NEIGHBORHOODS); _project.AddBuildingBlock(spatialStructure); var reactionBuilder = new ReactionBuilder().WithName(_reactionName); var reactions = new MoBiReactionBuildingBlock() { reactionBuilder }; _project.AddBuildingBlock(reactions); _project.AddSimulation(new MoBiSimulation().WithName(_simulationName)); var eventGroupBuilder = new EventGroupBuilder().WithName(_eventGroupName); var eventGroupBuildingBlock = new EventGroupBuildingBlock(); eventGroupBuildingBlock.Add(eventGroupBuilder); _project.AddBuildingBlock(eventGroupBuildingBlock); A.CallTo(() => _context.CurrentProject).Returns(_project); }