예제 #1
0
 public SelectYourPcsController(Func <IWeeeClient> apiclient, BreadcrumbService breadcrumb, IWeeeCache cache, IAddReturnSchemeRequestCreator requestCreator)
 {
     this.apiClient      = apiclient;
     this.breadcrumb     = breadcrumb;
     this.cache          = cache;
     this.requestCreator = requestCreator;
 }
예제 #2
0
 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;
 }
예제 #3
0
 public ReusedOffSiteSummaryListController(Func <IWeeeClient> apiClient, BreadcrumbService breadcrumb, IWeeeCache cache, IMapper mapper)
 {
     this.apiClient  = apiClient;
     this.breadcrumb = breadcrumb;
     this.cache      = cache;
     this.mapper     = mapper;
 }
예제 #4
0
 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;
 }
예제 #5
0
        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"]);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
 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;
 }
예제 #11
0
 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;
 }
예제 #15
0
 public ManageCacheController(
     IWeeeCache cache,
     BreadcrumbService breadcrumb)
 {
     this.cache      = cache;
     this.breadcrumb = breadcrumb;
 }
예제 #16
0
 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;
 }
예제 #17
0
 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);
 }
예제 #18
0
        public ObligatedValuesCopyPasteControllerTests()
        {
            breadcrumb = A.Fake <BreadcrumbService>();
            cache      = A.Fake <IWeeeCache>();
            weeeClient = weeeClient = A.Fake <IWeeeClient>();

            controller = new ObligatedValuesCopyPasteController(() => weeeClient, breadcrumb, cache);
        }
예제 #19
0
 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;
 }
예제 #20
0
 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;
 }
예제 #21
0
 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;
 }
예제 #22
0
        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);
        }
예제 #24
0
        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);
        }
예제 #25
0
        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;
 }
예제 #27
0
        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);
        }
예제 #28
0
 public ChargeController(
     IAppConfiguration configuration,
     BreadcrumbService breadcrumb,
     Func <IWeeeClient> weeeClient)
 {
     this.configuration = configuration;
     this.breadcrumb    = breadcrumb;
     this.weeeClient    = weeeClient;
 }
예제 #29
0
 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);
        }
예제 #31
0
        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);
        }
예제 #35
0
        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;
 }