protected override void Context()
        {
            _serializationTask            = A.Fake <ISerializationTask>();
            _dialogCreator                = A.Fake <IDialogCreator>();
            _iconRepository               = A.Fake <IIconRepository>();
            _nameCorrector                = A.Fake <INameCorrector>();
            _objectBaseTask               = A.Fake <IObjectBaseTask>();
            _cloneManagerForBuildingBlock = A.Fake <ICloneManagerForBuildingBlock>();
            _adjustFormulasVisitor        = A.Fake <IAdjustFormulasVisitor>();
            _objectTypeResolver           = A.Fake <IObjectTypeResolver>();
            _forbiddenNamesRetriever      = A.Fake <IForbiddenNamesRetriever>();

            sut = new InteractionTask(_serializationTask, _dialogCreator, _iconRepository, _nameCorrector, _objectBaseTask, _cloneManagerForBuildingBlock, _adjustFormulasVisitor, _objectTypeResolver, _forbiddenNamesRetriever);
        }
Example #2
0
        protected override void Context()
        {
            _simulation            = A.Fake <Simulation>();
            _competitiveInhibition = new InhibitionProcess {
                InteractionType = InteractionType.CompetitiveInhibition
            }.WithName("CompetitiveInhibition");
            _nonCompetitiveInhibition1 = new InhibitionProcess {
                InteractionType = InteractionType.NonCompetitiveInhibition
            }.WithName("NonCompetitiveInhibition1");
            _nonCompetitiveInhibition2 = new InhibitionProcess {
                InteractionType = InteractionType.NonCompetitiveInhibition
            }.WithName("NonCompetitiveInhibition2");
            _compound1 = new Compound().WithName("Compound1");
            _compound1.AddProcess(_competitiveInhibition);
            _interactionTask = new InteractionTask();

            _compound2 = new Compound().WithName("Compound2");
            _compound2.AddProcess(_nonCompetitiveInhibition1);
            _compound2.AddProcess(_nonCompetitiveInhibition2);

            _interactionProperties = new InteractionProperties();
            A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties);
            A.CallTo(() => _simulation.Compounds).Returns(new[] { _compound1, _compound2 });

            _objectPathFactory   = new ObjectPathFactoryForSpecs();
            _dimensionRepository = A.Fake <IDimensionRepository>();


            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _competitiveInhibition.Name, CompoundName = _compound1.Name
            });
            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _nonCompetitiveInhibition1.Name, CompoundName = _compound2.Name
            });
            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeName, ProcessName = _nonCompetitiveInhibition2.Name, CompoundName = _compound2.Name
            });


            _dimensionRepository = A.Fake <IDimensionRepository>();
            _objectPathFactory   = new ObjectPathFactoryForSpecs();
            sut = new NonCompetitiveInhibitionKineticUpdaterSpecification(_objectPathFactory, _dimensionRepository, _interactionTask);
        }
Example #3
0
        private IEnumerator ProcessInteractionTask(InteractionEventArgs eventArgs, Command command)
        {
            _activeInteraction = _interactionTaskTable[command];

            if (command.Gesture == GestureType.OneHandManipStart ||
                command.Gesture == GestureType.TwoHandManipStart)
            {
                _interactionTaskTable[new Command(GestureType.ManipulationUpdate)] = _activeInteraction;
                _interactionTaskTable[new Command(GestureType.ManipulationEnd)]    = _activeInteraction;
            }

            if (_activeInteraction != null)
            {
                yield return(_activeInteraction.Perform(eventArgs));
            }

            if (command.Gesture == GestureType.ManipulationEnd)
            {
                _interactionTaskTable[new Command(GestureType.ManipulationUpdate)] = null;
                _interactionTaskTable[new Command(GestureType.ManipulationEnd)]    = null;
                _activeInteraction = null;
            }
        }
Example #4
0
 protected override void Context()
 {
     sut = new InteractionTask();
 }
Example #5
0
 public void AddInteractionTask(Command command, InteractionTask task)
 => _interactionTaskTable.Add(command, task);