public SelectYourPcsController(Func <IWeeeClient> apiclient, BreadcrumbService breadcrumb, IWeeeCache cache, IAddReturnSchemeRequestCreator requestCreator) { this.apiClient = apiclient; this.breadcrumb = breadcrumb; this.cache = cache; this.requestCreator = requestCreator; }
public HomeController(IWeeeCache cache, BreadcrumbService breadcrumb, Func <IWeeeClient> client, IMap <AatfDataToHomeViewModelMapTransfer, HomeViewModel> mapper) { this.apiClient = client; this.breadcrumb = breadcrumb; this.cache = cache; this.mapper = mapper; }
public ReusedOffSiteSummaryListController(Func <IWeeeClient> apiClient, BreadcrumbService breadcrumb, IWeeeCache cache, IMapper mapper) { this.apiClient = apiClient; this.breadcrumb = breadcrumb; this.cache = cache; this.mapper = mapper; }
public SentOnRemoveSiteController(Func <IWeeeClient> apiClient, BreadcrumbService breadcrumb, IWeeeCache cache, IMap <ReturnAndAatfToSentOnRemoveSiteViewModelMapTransfer, SentOnRemoveSiteViewModel> mapper) { this.apiClient = apiClient; this.breadcrumb = breadcrumb; this.cache = cache; this.mapper = mapper; }
public async Task PostSearchResults_WithSelectedPRN_RedirectsToDetailsAction() { // Arrange BreadcrumbService breadcrumb = A.Dummy <BreadcrumbService>(); ISearcher <ProducerSearchResult> producerSearcher = A.Dummy <ISearcher <ProducerSearchResult> >(); Func <IWeeeClient> weeeClient = A.Dummy <Func <IWeeeClient> >(); ProducersController controller = new ProducersController(breadcrumb, producerSearcher, weeeClient, cache, configurationService); SearchResultsViewModel viewModel = new SearchResultsViewModel() { SelectedRegistrationNumber = "WEE/AA1111AA" }; // Act ActionResult result = await controller.SearchResults(viewModel); // Assert RedirectToRouteResult redirectResult = result as RedirectToRouteResult; Assert.NotNull(redirectResult); Assert.Equal("Details", redirectResult.RouteValues["action"]); Assert.Equal("WEE/AA1111AA", redirectResult.RouteValues["RegistrationNumber"]); }
public async void HttpGet_DownloadProducerEeeHistoryCsv_ShouldReturnFileContentType() { // Arrange BreadcrumbService breadcrumb = A.Dummy <BreadcrumbService>(); ISearcher <ProducerSearchResult> producerSearcher = A.Dummy <ISearcher <ProducerSearchResult> >(); IWeeeClient weeeClient = A.Fake <IWeeeClient>(); CSVFileData csvData = A.Dummy <CSVFileData>(); A.CallTo(() => weeeClient.SendAsync(A <string> ._, A <GetProducerEeeDataHistoryCsv> ._)) .Returns(new CSVFileData { FileName = "test.csv", FileContent = "123,abc" }); Func <IWeeeClient> weeeClientFunc = A.Fake <Func <IWeeeClient> >(); A.CallTo(() => weeeClientFunc()) .Returns(weeeClient); ProducersController controller = new ProducersController(breadcrumb, producerSearcher, weeeClientFunc, cache, configurationService); //Act var result = await controller.DownloadProducerEeeDataHistoryCsv("WEE/AA1111AA"); //Assert Assert.IsType <FileContentResult>(result); }
public void OnActionExecuting_Always_SetsBreadcrumbInternalActivityToManageCharges() { // Arrange IAppConfiguration configuration = A.Fake <IAppConfiguration>(); A.CallTo(() => configuration.EnableInvoicing).Returns(true); BreadcrumbService breadcrumb = new BreadcrumbService(); ChargeController controller = new ChargeController( configuration, breadcrumb, () => A.Dummy <IWeeeClient>()); // Act MethodInfo onActionExecutingMethod = typeof(ChargeController).GetMethod( "OnActionExecuting", BindingFlags.NonPublic | BindingFlags.Instance); object[] args = new object[] { A.Dummy <ActionExecutingContext>() }; try { onActionExecutingMethod.Invoke(controller, args); } catch (TargetInvocationException ex) { throw ex.InnerException; } // Assert Assert.Equal("Manage PCS charges", breadcrumb.InternalActivity); }
public CreatePcsDataReturnXmlFileController( Func <IWeeeClient> apiClient, BreadcrumbService breadcrumb) { this.apiClient = apiClient; this.breadcrumb = breadcrumb; }
public CreatePcsDataReturnXmlFileController( Func<IWeeeClient> apiClient, BreadcrumbService breadcrumb) { this.apiClient = apiClient; this.breadcrumb = breadcrumb; }
public SubmissionsController(BreadcrumbService breadcrumb, Func<IWeeeClient> client, IWeeeCache cache, CsvWriterFactory csvWriterFactory) { this.breadcrumb = breadcrumb; this.apiClient = client; this.cache = cache; this.csvWriterFactory = csvWriterFactory; }
public ReturnsController(Func <IWeeeClient> apiClient, BreadcrumbService breadcrumb, IWeeeCache cache, IMapper mapper) { this.apiClient = apiClient; this.breadcrumb = breadcrumb; this.cache = cache; this.mapper = mapper; }
public SchemeController(Func<IWeeeClient> apiClient, IWeeeCache cache, BreadcrumbService breadcrumb, IMapper mapper) { this.apiClient = apiClient; this.cache = cache; this.breadcrumb = breadcrumb; this.mapper = mapper; }
public ManageCacheController( IWeeeCache cache, BreadcrumbService breadcrumb) { this.cache = cache; this.breadcrumb = breadcrumb; }
public SubmissionsController(BreadcrumbService breadcrumb, Func <IWeeeClient> client, IWeeeCache cache, CsvWriterFactory csvWriterFactory) { this.breadcrumb = breadcrumb; this.apiClient = client; this.cache = cache; this.csvWriterFactory = csvWriterFactory; }
public ManageCacheController( IWeeeCache cache, BreadcrumbService breadcrumb) { this.cache = cache; this.breadcrumb = breadcrumb; }
public HomeController(Func <IWeeeClient> apiClient, IWeeeCache cache, BreadcrumbService breadcrumb, CsvWriterFactory csvWriterFactory, ConfigurationService configService) { this.apiClient = apiClient; this.cache = cache; this.breadcrumb = breadcrumb; this.csvWriterFactory = csvWriterFactory; this.configurationService = configService; }
public AatfTaskListControllerTests() { fixture = new Fixture(); weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); mapper = A.Fake <IMapper>(); controller = new AatfTaskListController(() => weeeClient, breadcrumb, A.Fake <IWeeeCache>(), mapper); }
public ObligatedValuesCopyPasteControllerTests() { breadcrumb = A.Fake <BreadcrumbService>(); cache = A.Fake <IWeeeCache>(); weeeClient = weeeClient = A.Fake <IWeeeClient>(); controller = new ObligatedValuesCopyPasteController(() => weeeClient, breadcrumb, cache); }
public ObligatedReceivedController(IWeeeCache cache, BreadcrumbService breadcrumb, Func <IWeeeClient> apiClient, IObligatedReceivedWeeeRequestCreator requestCreator, IMap <ReturnToObligatedViewModelMapTransfer, ObligatedViewModel> mapper) { this.apiClient = apiClient; this.requestCreator = requestCreator; this.mapper = mapper; this.breadcrumb = breadcrumb; this.cache = cache; }
public ContactDetailsController(IWeeeCache cache, BreadcrumbService breadcrumb, Func <IWeeeClient> client, IMapper mapper, IEditAatfContactRequestCreator contactRequestCreator) { this.apiClient = client; this.mapper = mapper; this.contactRequestCreator = contactRequestCreator; this.breadcrumb = breadcrumb; this.cache = cache; }
public SentOnCreateSiteController(Func <IWeeeClient> apiClient, BreadcrumbService breadcrumb, IWeeeCache cache, IAddSentOnAatfSiteRequestCreator requestCreator, IMap <ReturnAndAatfToSentOnCreateSiteViewModelMapTransfer, SentOnCreateSiteViewModel> mapper) { this.apiClient = apiClient; this.breadcrumb = breadcrumb; this.cache = cache; this.requestCreator = requestCreator; this.mapper = mapper; }
public ReusedOffSiteControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); cache = A.Fake <IWeeeCache>(); controller = new ReusedOffSiteController(() => weeeClient, breadcrumb, cache); }
public CheckYourReturnControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); mapper = A.Fake <IMapper>(); controller = new CheckYourReturnController(() => weeeClient, A.Fake <IWeeeCache>(), breadcrumb, mapper); }
public ReceivedPcsListControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); mapper = A.Fake <IMap <ReturnAndSchemeDataToReceivedPcsViewModelMapTransfer, ReceivedPcsListViewModel> >(); cache = A.Fake <IWeeeCache>(); controller = new ReceivedPcsListController(() => weeeClient, cache, breadcrumb, mapper); }
public ReturnsControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); mapper = A.Fake <IMapper>(); fixture = new Fixture(); controller = new ReturnsController(() => weeeClient, breadcrumb, A.Fake <IWeeeCache>(), mapper); }
public ChargeController( IAppConfiguration configuration, BreadcrumbService breadcrumb, Func<IWeeeClient> weeeClient) { this.configuration = configuration; this.breadcrumb = breadcrumb; this.weeeClient = weeeClient; }
public SubmittedReturnControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); mapper = A.Fake <IMapper>(); cache = A.Fake <IWeeeCache>(); controller = new SubmittedReturnController(() => weeeClient, cache, breadcrumb, mapper); }
public ChargeController( IAppConfiguration configuration, BreadcrumbService breadcrumb, Func <IWeeeClient> weeeClient) { this.configuration = configuration; this.breadcrumb = breadcrumb; this.weeeClient = weeeClient; }
public ReusedOffSiteCreateSiteControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); cache = A.Fake <IWeeeCache>(); requestCreator = A.Fake <IObligatedReusedSiteRequestCreator>(); mapper = A.Fake <IMap <SiteAddressDataToReusedOffSiteCreateSiteViewModelMapTransfer, ReusedOffSiteCreateSiteViewModel> >(); controller = new ReusedOffSiteCreateSiteController(() => weeeClient, breadcrumb, cache, requestCreator, mapper); }
public ReusedRemoveSiteControllerTests() { this.apiClient = A.Fake <IWeeeClient>(); this.breadcrumb = A.Fake <BreadcrumbService>(); this.cache = A.Fake <IWeeeCache>(); this.mapper = A.Fake <IMap <ReturnAndAatfToReusedRemoveSiteViewModelMapTransfer, ReusedRemoveSiteViewModel> >(); controller = new ReusedRemoveSiteController(() => apiClient, breadcrumb, cache, mapper); }
public ReusedOffSiteSummaryListControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); cache = A.Fake <IWeeeCache>(); mapper = A.Fake <IMapper>(); controller = new ReusedOffSiteSummaryListController(() => weeeClient, breadcrumb, cache, mapper); }
public SentOnSiteSummaryListControllerTests() { this.apiClient = A.Fake <IWeeeClient>(); this.breadcrumb = A.Fake <BreadcrumbService>(); this.cache = A.Fake <IWeeeCache>(); this.mapper = A.Fake <IMap <ReturnAndAatfToSentOnSummaryListViewModelMapTransfer, SentOnSiteSummaryListViewModel> >(); controller = new SentOnSiteSummaryListController(() => apiClient, breadcrumb, cache, mapper); }
public SelectReportOptionsNilControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); cache = A.Fake <IWeeeCache>(); mapper = A.Fake <IMap <ReturnDataToSelectReportOptionsNilViewModelMapTransfer, SelectReportOptionsNilViewModel> >(); requestCreator = A.Fake <IDeleteReturnDataRequestCreator>(); controller = new SelectReportOptionsNilController(() => weeeClient, breadcrumb, cache, mapper, requestCreator); }
public SelectYourPcsControllerTests() { weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); cache = A.Fake <IWeeeCache>(); requestCreator = A.Fake <IAddReturnSchemeRequestCreator>(); fixture = new Fixture(); controller = new SelectYourPcsController(() => weeeClient, breadcrumb, cache, requestCreator); }
public ReportsControllerTests() { fixture = new Fixture(); weeeClient = A.Fake <IWeeeClient>(); breadcrumb = A.Fake <BreadcrumbService>(); A.CallTo(() => weeeClient.SendAsync(A <string> ._, A <IRequest <UserStatus> > ._)).Returns(UserStatus.Active); controller = new ReportsController(() => weeeClient, breadcrumb); }
public MemberRegistrationController( Func<IWeeeClient> apiClient, IWeeeCache cache, BreadcrumbService breadcrumb, CsvWriterFactory csvWriterFactory, IMapper mapper) { this.apiClient = apiClient; this.cache = cache; this.breadcrumb = breadcrumb; this.csvWriterFactory = csvWriterFactory; this.mapper = mapper; }
public DataReturnsController( Func<IWeeeClient> apiClient, IWeeeCache cache, BreadcrumbService breadcrumb, CsvWriterFactory csvWriterFactory, IMapper mapper, ConfigurationService configService) { this.apiClient = apiClient; this.cache = cache; this.breadcrumb = breadcrumb; this.csvWriterFactory = csvWriterFactory; this.mapper = mapper; this.configService = configService; }
public FakeDataReturnsController( IWeeeClient apiClient, IWeeeCache cache, BreadcrumbService breadcrumb, CsvWriterFactory csvWriterFactory, IMapper mapper, ConfigurationService configurationService) : base(() => apiClient, cache, breadcrumb, csvWriterFactory, mapper, configurationService) { ApiClient = apiClient; }
public async Task PostSchemeWeeeData_Always_SetsInternalBreadcrumbToViewReports() { BreadcrumbService breadcrumb = new BreadcrumbService(); // Arrange ReportsController controller = new ReportsController( () => A.Dummy<IWeeeClient>(), breadcrumb); // Act ActionResult result = await controller.SchemeWeeeData(A.Dummy<ProducersDataViewModel>()); // Assert Assert.Equal("View reports", breadcrumb.InternalActivity); }
public void OnActionExecuting_Always_SetsBreadcrumbInternalActivityToManageCharges() { // Arrange IAppConfiguration configuration = A.Fake<IAppConfiguration>(); A.CallTo(() => configuration.EnableInvoicing).Returns(true); BreadcrumbService breadcrumb = new BreadcrumbService(); ChargeController controller = new ChargeController( configuration, breadcrumb, () => A.Dummy<IWeeeClient>()); // Act MethodInfo onActionExecutingMethod = typeof(ChargeController).GetMethod( "OnActionExecuting", BindingFlags.NonPublic | BindingFlags.Instance); object[] args = new object[] { A.Dummy<ActionExecutingContext>() }; try { onActionExecutingMethod.Invoke(controller, args); } catch (TargetInvocationException ex) { throw ex.InnerException; } // Assert Assert.Equal("Manage PCS charges", breadcrumb.InternalActivity); }
public FakeMemberRegistrationController( IWeeeClient apiClient, IWeeeCache cache, BreadcrumbService breadcrumb, CsvWriterFactory csvWriterFactory, IMapper mapper) : base(() => apiClient, cache, breadcrumb, csvWriterFactory, mapper) { ApiClient = apiClient; }
public async Task GetMissingProducerData_Always_SetsInternalBreadcrumbToViewReports() { BreadcrumbService breadcrumb = new BreadcrumbService(); // Arrange ReportsController controller = new ReportsController( () => A.Dummy<IWeeeClient>(), breadcrumb); // Act await controller.MissingProducerData(); // Assert Assert.Equal("View reports", breadcrumb.InternalActivity); }
public async Task GetProducerDetails_Always_SetsInternalBreadcrumbToViewReports() { BreadcrumbService breadcrumb = new BreadcrumbService(); // Arrange ReportsController controller = new ReportsController( () => A.Dummy<IWeeeClient>(), breadcrumb); // Act ActionResult result = await controller.ProducerDetails(); // Assert Assert.Equal("View reports", breadcrumb.InternalActivity); }
public async Task PostSchemeObligationData_Always_SetsInternalBreadcrumbToViewReports() { BreadcrumbService breadcrumb = new BreadcrumbService(); // Arrange ReportsController controller = new ReportsController( () => A.Dummy<IWeeeClient>(), breadcrumb); // Act await controller.SchemeObligationData(A.Dummy<ComplianceYearReportViewModel>()); // Assert Assert.Equal("View reports", breadcrumb.InternalActivity); }
public ReportsController(Func<IWeeeClient> apiClient, BreadcrumbService breadcrumb) { this.apiClient = apiClient; this.breadcrumb = breadcrumb; }