Ejemplo n.º 1
0
        public MutationTest(DatabaseFixture fixture)
        {
            this.fixture = fixture;

            ILoggerFactory factory = new NullLoggerFactory();

            _projectService          = new ProjectService(fixture.context);
            _evaluationService       = new EvaluationService(fixture.context);
            _participantService      = new ParticipantService(fixture.context);
            _questionService         = new QuestionService(fixture.context);
            _answerService           = new AnswerService(fixture.context);
            _actionService           = new ActionService(fixture.context);
            _noteService             = new NoteService(fixture.context);
            _closingRemarkService    = new ClosingRemarkService(fixture.context);
            _questionTemplateService = new QuestionTemplateService(fixture.context);
            _projectCategoryService  = new ProjectCategoryService(fixture.context);
            _authService             = new MockAuthService();
            _mutation = new Mutation(
                _projectService,
                _evaluationService,
                _participantService,
                _questionService,
                _answerService,
                _actionService,
                _noteService,
                _closingRemarkService,
                _questionTemplateService,
                _projectCategoryService,
                _authService,
                new Logger <Mutation>(factory)
                );

            _project = _projectService.Create("Project");
        }
Ejemplo n.º 2
0
 public Mutation(
     ProjectService projectService,
     EvaluationService evaluationService,
     ParticipantService participantService,
     QuestionService questionService,
     AnswerService answerService,
     ActionService actionService,
     NoteService noteService,
     ClosingRemarkService closingRemarkService,
     QuestionTemplateService questionTemplateService,
     ProjectCategoryService projectCategoryService,
     IAuthService authService,
     ILogger <Mutation> logger
     )
 {
     _projectService          = projectService;
     _evaluationService       = evaluationService;
     _participantService      = participantService;
     _questionService         = questionService;
     _answerService           = answerService;
     _actionService           = actionService;
     _noteService             = noteService;
     _closingRemarkService    = closingRemarkService;
     _questionTemplateService = questionTemplateService;
     _projectCategoryService  = projectCategoryService;
     _authService             = authService;
     _logger = logger;
 }
Ejemplo n.º 3
0
        public void GetQueryable()
        {
            ClosingRemarkService closingRemarkService = new ClosingRemarkService(fixture.context);

            IQueryable <ClosingRemark> closingRemarkQueryable = closingRemarkService.GetAll();

            Assert.True(closingRemarkQueryable.Count() > 0);
        }
Ejemplo n.º 4
0
        public void GetExists()
        {
            ClosingRemarkService closingRemarkService = new ClosingRemarkService(fixture.context);
            ParticipantService   participantService   = new ParticipantService(fixture.context);
            Participant          participant          = participantService.GetAll().First();
            ActionService        actionService        = new ActionService(fixture.context);
            Action action = actionService.GetAll().First();

            ClosingRemark ClosingRemarkCreate = closingRemarkService.Create(participant, "text", action);

            ClosingRemark ClosingRemarkGet = closingRemarkService.GetClosingRemark(ClosingRemarkCreate.Id);

            Assert.Equal(ClosingRemarkCreate, ClosingRemarkGet);
        }
Ejemplo n.º 5
0
        public void Create()
        {
            ParticipantService participantService = new ParticipantService(fixture.context);
            Participant        participant        = participantService.GetAll().First();
            ActionService      actionService      = new ActionService(fixture.context);
            Action             action             = actionService.GetAll().First();

            ClosingRemarkService closingRemarkService = new ClosingRemarkService(fixture.context);
            int nClosingRemarksBefore = closingRemarkService.GetAll().Count();

            closingRemarkService.Create(participant, "text", action);
            int nClosingRemarksAfter = closingRemarkService.GetAll().Count();

            Assert.Equal(nClosingRemarksBefore + 1, nClosingRemarksAfter);
        }
Ejemplo n.º 6
0
        public void GetDoesNotExist()
        {
            ClosingRemarkService closingRemarkService = new ClosingRemarkService(fixture.context);

            Assert.Throws <NotFoundInDBException>(() => closingRemarkService.GetClosingRemark("some_closingRemark_id_that_does_not_exist"));
        }