public ClosingRemark GetClosingRemark(string closingRemarkId) { ClosingRemark ClosingRemark = _context.ClosingRemarks.FirstOrDefault(closingRemark => closingRemark.Id.Equals(closingRemarkId)); if (ClosingRemark == null) { throw new NotFoundInDBException($"ClosingRemark not found: {closingRemarkId}"); } return(ClosingRemark); }
public void GetExists() { ClosingRemarkService closingRemarkService = new ClosingRemarkService(fixture.context); ParticipantService participantService = new ParticipantService(fixture.context); Participant participant = participantService.GetAll().First(); ActionService actionService = new ActionService(fixture.context); Action action = actionService.GetAll().First(); ClosingRemark ClosingRemarkCreate = closingRemarkService.Create(participant, "text", action); ClosingRemark ClosingRemarkGet = closingRemarkService.GetClosingRemark(ClosingRemarkCreate.Id); Assert.Equal(ClosingRemarkCreate, ClosingRemarkGet); }
protected ClosingRemark CreateClosingRemark( string actionId, string text = null) { if (text == null) { text = Randomize.String(); } ClosingRemark remark = _mutation.CreateClosingRemark( actionId: actionId, text: text ); return(remark); }
private static List <ClosingRemark> GetClosingRemarks() { var closingRemark1 = new ClosingRemark { Text = "ClosingRemark1", CreateDate = DateTimeOffset.UtcNow, Action = Actions[0], CreatedBy = Participants[0] }; var closingRemark2 = new ClosingRemark { Text = "ClosingRemark2", CreateDate = DateTimeOffset.UtcNow, Action = Actions[0], CreatedBy = Participants[0] }; return(new List <ClosingRemark>(new ClosingRemark[] { closingRemark1, closingRemark2 })); }
public ClosingRemark Create( Participant createdBy, string text, Action action ) { DateTimeOffset createDate = DateTimeOffset.UtcNow; ClosingRemark newClosingRemark = new ClosingRemark { CreateDate = createDate, Text = text, CreatedBy = createdBy, Action = action }; _context.ClosingRemarks.Add(newClosingRemark); _context.SaveChanges(); return(newClosingRemark); }