Ejemplo n.º 1
0
 protected override void Context()
 {
     base.Context();
     _buildingBlock = A.Fake <IBuildingBlock>();
     _simulation    = A.Fake <IMoBiSimulation>();
     _createCommitChangesCommandTask = A.Fake <ICreateCommitChangesToBuildingBlockCommandTask>();
     _command = A.Fake <MoBiEmptyCommand>();
     A.CallTo(() => _createCommitChangesCommandTaskRetriever.TaskFor(A <IBuildingBlock> ._)).Returns(_createCommitChangesCommandTask);
     sut.Initialize(_buildingBlock, _simulation);
     A.CallTo(() => _createCommitChangesCommandTask.CreateCommitToBuildingBlockCommand(_simulation, _buildingBlock)).Returns(_command);
 }
        public void Execute()
        {
            try
            {
                var commitToBuildingBlockCommand = _commitTask.CreateCommitToBuildingBlockCommand(_simulation, _templateBuildingBlock);
                if (commitToBuildingBlockCommand.IsEmpty())
                {
                    return;
                }

                _context.AddToHistory(commitToBuildingBlockCommand.Run(_context));
                _pendingChangesChecker.CheckForBuildingBlockChanges(_simulation.MoBiBuildConfiguration.BuildingInfoForTemplate(_templateBuildingBlock), _templateBuildingBlock);
            }
            finally
            {
                _templateBuildingBlock = null;
                _simulation            = null;
            }
        }
Ejemplo n.º 3
0
 public void should_create_the_commit_command()
 {
     A.CallTo(() => _createCommitChangesCommandTask.CreateCommitToBuildingBlockCommand(_simulation, _buildingBlock)).MustHaveHappened();
 }