protected override async Task Context()
        {
            await base.Context();

            _project              = new PKSimProject();
            _observedData         = DomainHelperForSpecs.ObservedData().WithName("subject");
            _originalClassifiable = _project.GetOrCreateClassifiableFor <ClassifiableObservedData, DataRepository>(_observedData);
            _subjects             = new List <DataRepository> {
                _observedData
            };
        }
        private async Task updateProjectFor <TClassifiable, TSubject>(PKSimProject project, SnapshotClassification snapshot, IReadOnlyCollection <TSubject> subjects, ModelClassification parent = null)
            where TClassifiable : Classifiable <TSubject>, new() where TSubject : IObjectBase
        {
            var classification = await _classificationMapper.MapToModel(snapshot, classificationTypeFor <TClassifiable>());

            classification.Parent = parent;
            project.AddClassification(classification);

            snapshot.Classifiables?.Each(snapshotClassifiable =>
            {
                var subject = subjects.FindByName(snapshotClassifiable);
                if (subject != null)
                {
                    var classifiable    = project.GetOrCreateClassifiableFor <TClassifiable, TSubject>(subject);
                    classifiable.Parent = classification;
                }
            });

            if (snapshot.Classifications != null)
            {
                var tasks = snapshot.Classifications.Select(x => updateProjectFor <TClassifiable, TSubject>(project, x, subjects, classification));
                await Task.WhenAll(tasks);
            }
        }
 public void should_not_crash_nor_update_the_existing_classifiable()
 {
     _project.GetOrCreateClassifiableFor <ClassifiableObservedData, DataRepository>(_observedData).ShouldBeEqualTo(_originalClassifiable);
 }