Пример #1
0
        public async Task CanCreateNewPlan()
        {
            string name     = "test";
            int    patrolId = 1;

            _planRepositoryMock.Setup(x => x.InsertPlan(It.Is <Plan>(y => y.Name == name && y.PatrolId == patrolId)))
            .Verifiable();

            await _planService.CreatePlan(name, patrolId, null);

            _planRepositoryMock.Verify();
        }
Пример #2
0
        protected async Task HandleValidSubmit()
        {
            PlanDto result = null;

            if (Semester.SemesterId != 0)
            {
                await SemesterService.UpdateSemester(AutumnSemester);

                await SemesterService.UpdateSemester(SpringSemester);

                await LecturerModuleRunService.UpdateLecturerModuleRun(Lmr);

                await ModuleRunService.UpdateModuleRun(MR);
            }

            if (Plan.Id != 0)
            {
                await PlanService.UpdatePlan(Plan);
            }
            else
            {
                result = await PlanService.CreatePlan(Plan);
            }
        }
Пример #3
0
 public ActionResult <PlanDto> CreatePlan(PlanBaseDto planDto)
 {
     return(Ok(_planService.CreatePlan(planDto)));
 }
 public bool Create(PlanDetailsDto plan)
 {
     return(planService.CreatePlan(plan));
 }