protected override void Context() { base.Context(); var displayUnitRetriever = IoC.Resolve <IDisplayUnitRetriever>(); var f1 = new ExplicitFormula("CL*conc").WithName("formula"); var r1 = new ReactionBuilder().WithName("Reaction").WithFormula(f1); r1.AddEduct(new ReactionPartnerBuilder("Drug", 1)); r1.AddEduct(new ReactionPartnerBuilder("Metab", 1)); r1.AddModifier("Cyp"); var concentrationDimension = DomainHelperForSpecs.ConcentrationDimensionForSpecs(); var p1Formula = new ConstantFormula(2).WithDimension(concentrationDimension); var p11 = new Parameter().WithName("P1").WithFormula(p1Formula).WithParentContainer(r1); var f2 = new ExplicitFormula("CL*conc").WithName("formula"); var r2 = new ReactionBuilder().WithName("Reaction").WithFormula(f2); r2.AddEduct(new ReactionPartnerBuilder("Drug", 1)); r2.AddEduct(new ReactionPartnerBuilder("Metab", 1)); r2.AddModifier("Cyp"); var p12Forumla = new ConstantFormula(3).WithDimension(concentrationDimension); var p12 = new Parameter().WithName("P1").WithFormula(p12Forumla).WithParentContainer(r2); _object1 = r1; _object2 = r2; _preferredUnit = concentrationDimension.Units.ElementAt(0); A.CallTo(() => displayUnitRetriever.PreferredUnitFor(p1Formula, null)).Returns(_preferredUnit); A.CallTo(() => displayUnitRetriever.PreferredUnitFor(p12Forumla, null)).Returns(_preferredUnit); }
protected override void Context() { _reactionBuildingBlock = new MoBiReactionBuildingBlock(); _moBiReactionDiagramManager = A.Fake <IMoBiReactionDiagramManager>(); _reactionBuildingBlock.DiagramManager = _moBiReactionDiagramManager; _reaction = new ReactionBuilder().WithName("R"); _reaction.AddModifier("old"); sut = new ChangeModifierCommand("new", "old", _reaction, _reactionBuildingBlock); }
protected ReactionBuilder createReaction() { var reaction = new ReactionBuilder(); reaction.AddEduct(new ReactionPartnerBuilder("educt", 1.0)); reaction.AddProduct(new ReactionPartnerBuilder("product", 1.0)); reaction.AddModifier("modifier"); return(reaction); }
protected override void Context() { base.Context(); var f1 = new ExplicitFormula("CL*conc").WithName("formula"); var r1 = new ReactionBuilder().WithName("Reaction").WithFormula(f1); r1.AddEduct(new ReactionPartnerBuilder("Drug", 1)); r1.AddEduct(new ReactionPartnerBuilder("Metab", 1)); r1.AddModifier("Cyp"); var p11 = new Parameter().WithName("P1").WithFormula(new ConstantFormula(2)).WithParentContainer(r1); var f2 = new ExplicitFormula("CL*conc").WithName("formula"); var r2 = new ReactionBuilder().WithName("Reaction").WithFormula(f2); r2.AddEduct(new ReactionPartnerBuilder("Drug", 1)); r2.AddEduct(new ReactionPartnerBuilder("Metab2", 1)); r2.AddModifier("Cyp"); var p12 = new Parameter().WithName("P1").WithFormula(new ConstantFormula(2)).WithParentContainer(r2); _object1 = r1; _object2 = r2; }