Beispiel #1
0
 public ProjectPersistor(ISessionManager sessionManager, IProjectToProjectMetaDataMapper projectToProjectMetaDataMapper,
                         IProjectMetaDataToProjectMapper projectMetaDataToProjectMapper, IPostSerializationStepsMaker postSerializationStepsMaker,
                         ISerializationContextFactory serializationContextFactory)
 {
     _sessionManager = sessionManager;
     _projectToProjectMetaDataMapper = projectToProjectMetaDataMapper;
     _projectMetaDataToProjectMapper = projectMetaDataToProjectMapper;
     _postSerializationStepsMaker    = postSerializationStepsMaker;
     _serializationContextFactory    = serializationContextFactory;
 }
        protected override void Context()
        {
            _project         = A.Fake <PKSimProject>();
            _session         = A.Fake <ISession>();
            _projectMetaData = new ProjectMetaData {
                Id = 1
            };
            _listOfProjectsInDatabase       = new List <ProjectMetaData>();
            _projectToProjectMetaDataMapper = A.Fake <IProjectToProjectMetaDataMapper>();
            _projectMetaDataToProjectMapper = A.Fake <IProjectMetaDataToProjectMapper>();
            A.CallTo(() => _session.BeginTransaction()).Returns(A.Fake <ITransaction>());
            var criteria = A.Fake <ICriteria>();

            A.CallTo(() => _session.CreateCriteria <ProjectMetaData>()).Returns(criteria);
            A.CallTo(() => criteria.List <ProjectMetaData>()).Returns(_listOfProjectsInDatabase);
            sut = new ProjectPersistor(_projectToProjectMetaDataMapper, _projectMetaDataToProjectMapper);
        }
Beispiel #3
0
 public ProjectPersistor(IProjectToProjectMetaDataMapper projectToProjectMetaDataMapper,
                         IProjectMetaDataToProjectMapper projectMetaDataToProjectMapper)
 {
     _projectToProjectMetaDataMapper = projectToProjectMetaDataMapper;
     _projectMetaDataToProjectMapper = projectMetaDataToProjectMapper;
 }