public static IValueProvider ValueProvider(TicketSpecification spec) { return(new SimpleValueProvider() { { "Title", spec.Title }, { "TicketTypeId", spec.TicketTypeId }, { "IncludeClosed", spec.IncludeClosed } }); }
public IPagedList <TicketSearchResult> SearchTickets(TicketSpecification specification, int?pageIndex, int?pageSize) { return(WithValid(specification, () => { var result = ticketRepository.RetrieveMultiple(specification, pageIndex, pageSize, ticketPagingSettings); result.ForEach(t => t.TicketType = TicketTypeMap[t.TicketTypeId]); return result; })); }
public NameValueCollection Search(TicketSpecification specification) { var page = Browser.Page <TicketsSearchPage>(); return(page.Container .Fill(specification) .Submit() .OnErrorMessage(m => { throw new InvalidOperationException(m); }) .ValidationErrors()); }
public ActionResult List(int?pageIndex, int?pageSize) { var model = new TicketSpecification(); if (!TryUpdateModel(model)) { return(new BadRequestResult()); } return(List(model, pageIndex, pageSize)); }
public void RetrieveMultiple(TicketSpecification spec) { // Arrange var req = new RetrieveMultipleRequest <TicketSpecification>(spec) { PageSize = 50 }; // Act var result = Repository.RetrieveMultiple(req); // Assert Assert.NotNull(result); }
private ActionResult List(TicketSpecification specification, int?pageIndex, int?pageSize) { var viewData = new TicketListViewData() { Specification = specification, Items = ticketService.SearchTickets(specification, pageIndex, pageSize) }; if (viewData.Items == null) { return(new BadRequestResult()); } return(AlternatePartialView("List", viewData)); }
public static void Equal(TicketSpecification expected, TicketSpecification actual) { Assert.Equal(expected.Title, actual.Title); Assert.Equal(expected.TicketTypeId, actual.TicketTypeId); Assert.Equal(expected.IncludeClosed, actual.IncludeClosed); }