示例#1
0
        public HomeControllerTests()
        {
            mediator = A.Fake <IMediator>();

            controller = new HomeController(mediator);

            postModel = new BasicSearchViewModel
            {
                SearchTerm = "GB001"
            };

            searchResults = new[]
            {
                new BasicSearchResult
                {
                    ExporterName       = "test",
                    Id                 = new Guid("211C1DE8-906C-49DB-835C-4C2B78673B68"),
                    NotificationNumber = "GB 0001 000525",
                    WasteType          = "RDF"
                },
                new BasicSearchResult
                {
                    ExporterName       = "test2",
                    Id                 = new Guid("ECCAA419-B2D5-4B4B-9E45-57218D2C4C69"),
                    NotificationNumber = "GB 0001 000530",
                    WasteType          = "Other"
                }
            };

            A.CallTo(() => mediator.SendAsync(A <SearchExportNotifications> .Ignored)).Returns(searchResults);
        }
示例#2
0
        public ActionResult Search(BasicSearchViewModel model)
        {
            var results = _listingService.Search(model);

            PopulateBasicSearch(model);
            return(View(results));
        }
 public async Task<ActionResult> Index()
 {
     var model = new BasicSearchViewModel
     {
         AttentionSummaryTable = await mediator.SendAsync(new GetNotificationAttentionSummary())
     };
     
     return View(model);
 }
示例#4
0
        public async Task <ActionResult> Index()
        {
            var model = new BasicSearchViewModel
            {
                AttentionSummaryTable = await mediator.SendAsync(new GetNotificationAttentionSummary())
            };

            return(View(model));
        }
示例#5
0
 private void PopulateBasicSearch(BasicSearchViewModel model)
 {
     model.MerchandisingTypes = Enum.GetValues(typeof(TypeOfMerchandising)).Cast <TypeOfMerchandising>()
                                .Select(c => new SelectListItem {
         Value = c.ToString(), Text = c.GetDisplayName()
     })
                                .ToList();
     model.PropertyTypes = Enum.GetValues(typeof(PropertyType)).Cast <PropertyType>()
                           .Select(c => new SelectListItem {
         Value = c.ToString(), Text = c.GetDisplayName()
     })
                           .ToList();
     FillLocInfo(model);
 }
        public async Task<ActionResult> Index(BasicSearchViewModel model)
        {
            var searchResults = await mediator.SendAsync(model.ToRequest());
            var importSearchResults = await mediator.SendAsync(new SearchImportNotifications(model.SearchTerm));

            if (searchResults != null)
            {
                model.ExportSearchResults = searchResults;
            }

            if (importSearchResults != null)
            {
                model.ImportSearchResults = importSearchResults;
            }

            model.HasSearched = true;

            model.AttentionSummaryTable = await mediator.SendAsync(new GetNotificationAttentionSummary());

            return View(model);
        }
示例#7
0
        public async Task <ActionResult> Index(BasicSearchViewModel model)
        {
            var searchResults = await mediator.SendAsync(model.ToRequest());

            var importSearchResults = await mediator.SendAsync(new SearchImportNotifications(model.SearchTerm));

            if (searchResults != null)
            {
                model.ExportSearchResults = searchResults;
            }

            if (importSearchResults != null)
            {
                model.ImportSearchResults = importSearchResults;
            }

            model.HasSearched = true;

            model.AttentionSummaryTable = await mediator.SendAsync(new GetNotificationAttentionSummary());

            return(View(model));
        }