public void Output_Success_ApproveApiSurface() { // Arrange var output = new GetEventListOutput( new List <GetEventListOutput.EventRow> { new GetEventListOutput.EventRow( new Guid("C76468FE-86AE-43EC-B2D5-28FC61DA04AA"), new DateTime(2019, 10, 5, 19, 0, 0), null, "The Title", "The Location", "The MeetingPoint" ) }); // Act presenter.Output(output); var jsonObject = presenter.GetJsonObject(); // Assert var json = JsonConvert.SerializeObject(jsonObject); Approvals.VerifyJson(json); }
public void Output(GetEventListOutput interactorOutput) { viewModel = new MvcEventListViewModel( interactorOutput.Rows.Select(r => new MvcEventListViewModel.RowViewModel( r.EventId, r.StartTime.FormatTimeRange(r.EndTime), r.Title, r.Location, r.MeetingPoint ))); }
public void Output([NotNull] GetEventListOutput interactorOutput) { if (interactorOutput == null) { throw new ArgumentNullException(nameof(interactorOutput)); } jsonObject = interactorOutput.Rows.Select(r => new { eventId = r.EventId, title = r.Title, location = r.Location, meetingPoint = r.MeetingPoint, startTime = r.StartTime.ToString("O"), endTime = r.EndTime?.ToString("O"), }); }