public SubmissionsController(BreadcrumbService breadcrumb, Func<IWeeeClient> client, IWeeeCache cache, CsvWriterFactory csvWriterFactory)
 {
     this.breadcrumb = breadcrumb;
     this.apiClient = client;
     this.cache = cache;
     this.csvWriterFactory = csvWriterFactory;
 }
 public SubmissionsController(BreadcrumbService breadcrumb, Func <IWeeeClient> client, IWeeeCache cache, CsvWriterFactory csvWriterFactory)
 {
     this.breadcrumb       = breadcrumb;
     this.apiClient        = client;
     this.cache            = cache;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #3
0
 /// <summary>
 /// Initialize instance of FormatTransformer class for the specified input and output file name.
 /// </summary>
 /// <param name="sourceFilePath"></param>
 /// <param name="outputFilePath"></param>
 public FormatTransformer(string sourceFilePath, string outputFilePath)
 {
     this.sourceFilePath = sourceFilePath;
     this.outputFilePath = outputFilePath;
     readerFactory       = new CsvReaderFactory(this.sourceFilePath);
     writerFactory       = new CsvWriterFactory(this.outputFilePath);
 }
예제 #4
0
 /// <summary>
 /// Initialize instance of FormatTransformer class for default config setting input and output file name.
 /// </summary>
 public FormatTransformer()
 {
     this.sourceFilePath = ConfigurationManager.AppSettings["StandardFileSourcePath"];
     this.outputFilePath = ConfigurationManager.AppSettings["StandardFileOutputPath"];
     readerFactory       = new CsvReaderFactory(this.sourceFilePath);
     writerFactory       = new CsvWriterFactory(this.outputFilePath);
 }
 public GetProducerPublicRegisterCSVHandler(IWeeeAuthorization authorization, WeeeContext context,
                                            CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.context          = context;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #6
0
 public GetUkEeeDataCsvHandler(IWeeeAuthorization authorization, WeeeContext context,
                               CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.context          = context;
     this.csvWriterFactory = csvWriterFactory;
 }
 public GetUkNonObligatedWeeeReceivedDataCsvHandler(IWeeeAuthorization authorization, WeeeContext context,
                                                    CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.context          = context;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #8
0
        public async Task GetProducerCSVHandler_OrganisationDoesNotExist_ThrowsArgumentException()
        {
            // Arrange
            Guid pcsId          = new Guid("62874744-6F52-4311-B4C0-3DD7767BEBF6");
            int  complianceYear = 2016;

            IWeeeAuthorization authorization = AuthorizationBuilder.CreateUserWithAllRights();

            WeeeContext context       = A.Fake <WeeeContext>();
            var         organisations = dbContextHelper.GetAsyncEnabledDbSet <Organisation>(new List <Organisation>());

            A.CallTo(() => organisations.FindAsync(pcsId)).Returns((Organisation)null);
            A.CallTo(() => context.Organisations).Returns(organisations);

            var schemes = dbContextHelper.GetAsyncEnabledDbSet <Scheme>(new List <Scheme>
            {
                new Scheme(pcsId)
            });

            A.CallTo(() => context.Schemes).Returns(schemes);

            CsvWriterFactory csvWriterFactory = A.Fake <CsvWriterFactory>();

            var handler = new GetProducerCSVHandler(authorization, context, csvWriterFactory);
            var request = new GetProducerCSV(pcsId, complianceYear);

            // Act
            Func <Task> action = async() => await handler.HandleAsync(request);

            // Assert
            await Assert.ThrowsAsync <ArgumentException>(action);
        }
 public GetAllAatfReuseSitesCsvHandler(IWeeeAuthorization authorization, WeeeContext weeContext,
                                       CsvWriterFactory csvWriterFactory, ICommonDataAccess commonDataAccess)
 {
     this.authorization    = authorization;
     this.weeContext       = weeContext;
     this.commonDataAccess = commonDataAccess;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #10
0
 public GetAatfObligatedDataHandler(IWeeeAuthorization authorization, WeeeContext weeContext,
                                    CsvWriterFactory csvWriterFactory, IGetAatfsDataAccess aatfDataAccess)
 {
     this.authorization    = authorization;
     this.weeContext       = weeContext;
     this.aatfDataAccess   = aatfDataAccess;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #11
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;
 }
예제 #12
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;
 }
예제 #13
0
 public FetchSummaryCsvHandler(
     IWeeeAuthorization authorization,
     CsvWriterFactory csvWriterFactory,
     IFetchSummaryCsvDataAccess dataAccess)
 {
     this.authorization    = authorization;
     this.csvWriterFactory = csvWriterFactory;
     this.dataAccess       = dataAccess;
 }
예제 #14
0
 public GetSchemeWeeeCsvHandler(
     IStoredProcedures storedProcedures,
     IWeeeAuthorization authorization,
     CsvWriterFactory csvWriterFactory)
 {
     this.storedProcedures = storedProcedures;
     this.authorization    = authorization;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #15
0
 public GetMissingProducerDataCsvHandler(
     IWeeeAuthorization authorization,
     IGetMissingProducerDataCsvDataProcessor dataProcessor,
     CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.dataProcessor    = dataProcessor;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #16
0
 public GetUkWeeeAtAatfsCsvHandler(
     IWeeeAuthorization authorization,
     IGetUkWeeeAtAatfsCsvDataAccess dataAccess,
     CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.dataAccess       = dataAccess;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #17
0
 public GetProducerEeeDataCsvHandler(
     IWeeeAuthorization authorization,
     IGetProducerEeeDataCsvDataAccess dataAccess,
     CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.dataAccess       = dataAccess;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #18
0
 public GetSchemeObligationDataCsvHandler(
     IWeeeAuthorization authorization,
     IGetSchemeObligationCsvDataProcessor dataProcessor,
     CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.dataProcessor    = dataProcessor;
     this.csvWriterFactory = csvWriterFactory;
 }
 public FetchIssuedChargesCsvHandler(
     IWeeeAuthorization authorization,
     IFetchIssuedChargesCsvDataAccess dataAccess,
     CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.dataAccess       = dataAccess;
     this.csvWriterFactory = csvWriterFactory;
 }
        public GetAllAatfReuseSitesCsvHandlerTests()
        {
            var authorization = new AuthorizationBuilder().AllowInternalAreaAccess().Build();

            context          = A.Fake <WeeeContext>();
            csvWriterFactory = A.Fake <CsvWriterFactory>();
            commonDataAccess = A.Fake <ICommonDataAccess>();

            handler = new GetAllAatfReuseSitesCsvHandler(authorization, context, csvWriterFactory, commonDataAccess);
        }
        public void Create_BuildsInstance()
        {
            var f      = new CsvWriterFactory();
            var config = new Configuration();
            var tw     = Mock.Of <TextWriter>();

            var instance = f.Create(tw, config);

            Assert.NotNull(instance);
        }
        public GetNonObligatedWeeeReceivedAtAatfsDataCsvHandlerTests()
        {
            context          = A.Fake <WeeeContext>();
            csvWriterFactory = A.Fake <CsvWriterFactory>();
            fixture          = new Fixture();

            var authorization = new AuthorizationBuilder().AllowInternalAreaAccess().Build();

            handler = new GetNonObligatedWeeeReceivedDataAtAatfsCsvHandler(authorization, context, csvWriterFactory);
        }
예제 #23
0
 public FetchInvoiceRunCsvHandler(IWeeeAuthorization authorization,
                                  WeeeContext context,
                                  ICommonDataAccess commonDataAccess,
                                  CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.context          = context;
     this.commonDataAccess = commonDataAccess;
     this.csvWriterFactory = csvWriterFactory;
 }
예제 #24
0
 public GetPcsAatfComparisonDataHandler(IWeeeAuthorization authorization,
                                        WeeeContext context,
                                        CsvWriterFactory csvWriterFactory,
                                        ICommonDataAccess commonDataAccess)
 {
     this.authorization    = authorization;
     this.context          = context;
     this.csvWriterFactory = csvWriterFactory;
     this.commonDataAccess = commonDataAccess;
 }
예제 #25
0
 public GetAatfAeDetailsCsvHandler(IWeeeAuthorization authorization,
                                   WeeeContext context,
                                   CsvWriterFactory csvWriterFactory,
                                   ICommonDataAccess commonDataAccess)
 {
     this.authorization    = authorization;
     this.context          = context;
     this.csvWriterFactory = csvWriterFactory;
     this.commonDataAccess = commonDataAccess;
 }
 public GetReturnNonObligatedCsvHandler(IWeeeAuthorization authorization,
                                        WeeeContext weeContext,
                                        IGenericDataAccess dataAccess,
                                        CsvWriterFactory csvWriterFactory)
 {
     this.authorization    = authorization;
     this.weeContext       = weeContext;
     this.dataAccess       = dataAccess;
     this.csvWriterFactory = csvWriterFactory;
 }
 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;
 }
예제 #28
0
 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;
 }
예제 #29
0
 public FakeMemberRegistrationController(
     IWeeeClient apiClient,
     IWeeeCache cache,
     BreadcrumbService breadcrumb,
     CsvWriterFactory csvWriterFactory,
     IMapper mapper)
     : base(() => apiClient,
            cache,
            breadcrumb,
            csvWriterFactory,
            mapper)
 {
     ApiClient = apiClient;
 }
        public GetUkNonObligatedWeeeReceivedDataCsvHandlerTests()
        {
            context          = A.Fake <WeeeContext>();
            csvWriterFactory = A.Fake <CsvWriterFactory>();
            storedProcedures = A.Fake <IStoredProcedures>();
            fixture          = new Fixture();

            A.CallTo(() => context.StoredProcedures).Returns(storedProcedures);

            handler = new GetUkNonObligatedWeeeReceivedDataCsvHandler(
                new AuthorizationBuilder().AllowInternalAreaAccess().Build(),
                context,
                csvWriterFactory);
        }
예제 #31
0
        public GetReturnNonObligatedCsvHandlerTests()
        {
            context          = A.Fake <WeeeContext>();
            csvWriterFactory = A.Fake <CsvWriterFactory>();
            dataAccess       = A.Fake <IGenericDataAccess>();
            storedProcedures = A.Fake <IStoredProcedures>();
            fixture          = new Fixture();

            A.CallTo(() => context.StoredProcedures).Returns(storedProcedures);

            var authorization = new AuthorizationBuilder().AllowInternalAreaAccess().Build();

            handler = new GetReturnNonObligatedCsvHandler(authorization, context, dataAccess, csvWriterFactory);
        }
예제 #32
0
 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 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;
 }
예제 #34
0
        public GetAatfAeDetailsCsvHandlerTests()
        {
            context          = A.Fake <WeeeContext>();
            csvWriterFactory = A.Fake <CsvWriterFactory>();
            fixture          = new Fixture();
            storedProcedures = A.Fake <IStoredProcedures>();
            commonDataAccess = A.Fake <ICommonDataAccess>();

            A.CallTo(() => context.StoredProcedures).Returns(storedProcedures);

            handler = new GetAatfAeDetailsCsvHandler(new AuthorizationBuilder().AllowInternalAreaAccess().Build(),
                                                     context,
                                                     csvWriterFactory,
                                                     commonDataAccess);
        }
 public FakeMemberRegistrationController(
     IWeeeClient apiClient,
     IWeeeCache cache,
     BreadcrumbService breadcrumb,
     CsvWriterFactory csvWriterFactory,
     IMapper mapper)
     : base(() => apiClient,
     cache,
     breadcrumb,
     csvWriterFactory,
      mapper)
 {
     ApiClient = apiClient;
 }
 public FakeDataReturnsController(
     IWeeeClient apiClient,
     IWeeeCache cache,
     BreadcrumbService breadcrumb,
     CsvWriterFactory csvWriterFactory,
     IMapper mapper,
     ConfigurationService configurationService)
     : base(() => apiClient,
     cache,
     breadcrumb,
     csvWriterFactory,
      mapper,
      configurationService)
 {
     ApiClient = apiClient;
 }