public async void Create_phase_valid_input_Integration() { var phase = new PhaseDTO(); var results = await _phaseLogic.Create(phase); Assert.Equal(phase.Id, results); }
public void Create_phase_valid_input() { var phase = new PhaseDTO(); _phaseDtoRepository.Setup(a => a.CreateAsync(It.IsAny <PhaseDTO>())).ReturnsAsync(phase.Id); var results = _phaseLogic.Create(phase).Result; Assert.Equal(phase.Id, results); }
public async Task <IActionResult> CreatePhase([FromBody] PhaseDTO phase) { if (!ModelState.IsValid || phase.Id != 0) { return(BadRequest(ModelState)); } var create = await _phaseLogic.Create(phase); //phase.Id = create; return(Ok()); //return Ok(phase.Id); //return CreatedAtAction("GetPhaseById", new { id = phase.Id }, phase); }