public async Task <IDataResult <Evidence> > AddEvidenceAsync(CreateEvidenceDTO createEvidenceDTO) { var uploadResult = await _cloudinaryOperations.UploadImageAsync(createEvidenceDTO.ImageFile); var evidence = _mapper.Map <Evidence>(createEvidenceDTO); await AddEvidenceWithImageAsync(evidence, uploadResult); return(new SuccessfulDataResult <Evidence>(evidence, HttpStatusCode.OK)); }
public async Task CreateEvidenceOnMission() { CreateEvidenceDTO createEvidenceDTO = new CreateEvidenceDTO { Argument = "evidence", MissionId = 1 }; // Arrange MissionManager _missionService = new MissionManager(_mockMissionDal.Object, _mapper, _mockEvidenceService.Object, _mockCloudinaryOperations.Object); // Act await _missionService.CreateEvidenceOnMission(createEvidenceDTO); // Assert Assert.IsTrue(_missions.Find(m => m.Id == createEvidenceDTO.MissionId).Evidences.Count > 0); }
public async Task <IActionResult> CreateEvidenceOnMission([FromForm] CreateEvidenceDTO createEvidenceDTO) { await _missionService.CreateEvidenceOnMission(createEvidenceDTO); return(StatusCode(200)); }
public async Task CreateEvidenceOnMission(CreateEvidenceDTO createEvidenceDTO) { await _evidenceService.AddEvidenceAsync(createEvidenceDTO); }
public async Task <IActionResult> CreateEvidence([FromForm] CreateEvidenceDTO createEvidenceDTO) { var result = await _evidenceService.AddEvidenceAsync(createEvidenceDTO); return(StatusCode(result.HttpStatusCode, result.Data)); }