Exemplo n.º 1
0
        public async Task <IActionResult> GetPhaseById(int id)
        {
            var get = await _phaseLogic.GetById(id);

            if (get == null)
            {
                return(NotFound());
            }

            return(Ok(get));
        }
        public async Task <IActionResult> Get(int id)
        {
            var phase = await _logic.GetById(id);

            if (phase == null)
            {
                return(NotFound());
            }
            return(Ok(phase));
        }
Exemplo n.º 3
0
        public async void Get_Phase_By_Id_Valid_Input_Integration()
        {
            var phase = new PhaseDTO {
                Id                = 0,
                Purpose           = "something",
                DisplayFields     = null,
                Participants      = null,
                InputFields       = null,
                TaskDelegations   = null,
                IsAutomatic       = false,
                ConflictManager   = null,
                OverlapPercentage = 10
            };

            var result = await _phaseLogic.GetById(phase.Id);

            Assert.Equal(phase, result);
            Assert.Equal(phase.Purpose, result.Purpose);
        }
Exemplo n.º 4
0
 public EngagementType(IStudentLogic studentLogic, IPhaseLogic phaseLogic)
 {
     Field(x => x.ProjectID);
     Field(x => x.StudentID);
     Field(x => x.DocumentID);
     Field(x => x.Description);
     Field(x => x.Name);
     Field(x => x.PhaseID);
     FieldAsync <StudentType>("student", resolve: async context => { return(await studentLogic.GetById(context.Source.StudentID)); });
     FieldAsync <PhaseType>("phase", resolve: async context => { return(await phaseLogic.GetById(context.Source.PhaseID)); });
 }
Exemplo n.º 5
0
        public void Get_Phase_By_Id_Valid_Input()
        {
            var phase = new PhaseDTO
            {
                Id                = 0,
                Purpose           = "something",
                DisplayFields     = null,
                Participants      = null,
                InputFields       = null,
                TaskDelegations   = null,
                IsAutomatic       = false,
                ConflictManager   = null,
                OverlapPercentage = 10
            };

            _phaseDtoRepository.Setup(a => a.ReadAsync(It.IsAny <int>())).ReturnsAsync(phase);

            var result = _phaseLogic.GetById(phase.Id).Result;

            Assert.Equal(phase, result);
            Assert.Equal(phase.Purpose, result.Purpose);
        }
Exemplo n.º 6
0
 public PhaseQuery(IPhaseLogic phaseLogic)
 {
     FieldAsync <PhaseType>(
         "phasetById",
         arguments: new QueryArguments(new QueryArgument <IntGraphType>
     {
         Name = "id"
     }),
         resolve: async context => { return(await phaseLogic.GetById(context.GetArgument <int>("id"))); }
         );
     FieldAsync <ListGraphType <PhaseType> >(
         "phasesByProjectPlan",
         arguments: new QueryArguments(new QueryArgument <LongGraphType>
     {
         Name = "projectPlanId"
     }),
         resolve: async context => { return(await phaseLogic.GetByProjectPlan(context.GetArgument <long>("projectPlanId"))); }
         );
 }