public async Task Set_Attende_Like_Organizer() { FillData(); var update = new UpdateAttendeeCommand { Organizer = true }; var response = await HttpClient.PutAsync($"/events/{_newEvent.Id}/Members/{_newMember.Id}/attende", new StringContent(JsonConvert.SerializeObject(update), Encoding.UTF8, "application/json")); var attendant = await response.Content.ReadAsAsync <AttendantViewModel>(); response.StatusCode.Should().Be(HttpStatusCode.OK); RefreshContext(); var attendance = Context.Attendances.FirstOrDefault(x => x.MemberId == _newMember.Id); attendance.Speaker.Should().BeFalse(); attendance.Organizer.Should().BeTrue(); attendance.Attended.Should().BeTrue(); attendance.DidNotAttend.Should().BeFalse(); }
public async Task <IActionResult> UpdateAttendeAttended([FromRoute] int id, [FromRoute] int idMember, UpdateAttendeeCommand command) { command.EventId = id; command.MemberId = idMember; return(await _iMediator.Send(command)); }