예제 #1
0
        private DataTable getTableFor(PopulationSimulationComparison populationSimulationComparison)
        {
            var dt = new DataTable(PKSimConstants.UI.SimulationsUsedInComparison);

            dt.AddColumn(PKSimConstants.ObjectTypes.Simulation);
            if (populationSimulationComparison.ReferenceSimulation != null)
            {
                dt.AddColumn <bool>(PKSimConstants.UI.ReferenceSimulation);
            }

            dt.BeginLoadData();
            foreach (var simulation in populationSimulationComparison.AllSimulations())
            {
                var row = dt.NewRow();
                row[PKSimConstants.ObjectTypes.Simulation] = simulation.Name;
                if (populationSimulationComparison.ReferenceSimulation != null)
                {
                    row[PKSimConstants.UI.ReferenceSimulation] = (simulation.Name == populationSimulationComparison.ReferenceSimulation.Name);
                }
                dt.Rows.Add(row);
            }
            dt.EndLoadData();

            return(dt);
        }
 protected override void Context()
 {
     base.Context();
     _comparison            = A.Fake <PopulationSimulationComparison>();
     _populationSimulation1 = A.Fake <PopulationSimulation>();
     _populationSimulation2 = A.Fake <PopulationSimulation>();
     A.CallTo(() => _comparison.AllSimulations()).Returns(new[] { _populationSimulation1, _populationSimulation2 });
     A.CallTo(() => _containerTask.CacheAllChildrenSatisfying(_populationSimulation1.Model.Root, A <Func <IParameter, bool> > ._)).Returns(new PathCacheForSpecs <IParameter> {
         _p1, _p2, _p4
     });
     A.CallTo(() => _containerTask.CacheAllChildrenSatisfying(_populationSimulation2.Model.Root, A <Func <IParameter, bool> > ._)).Returns(new PathCacheForSpecs <IParameter> {
         _p2, _p3, _p4
     });
 }