Esempio n. 1
0
        public ProcessXMLFileHandlerTests()
        {
            memberUploadsDbSet           = A.Fake <DbSet <MemberUpload> >();
            producersDbSet               = A.Fake <DbSet <ProducerSubmission> >();
            xmlConverter                 = A.Fake <IXmlConverter>();
            producerSubmissionDataAccess = A.Fake <IProducerSubmissionDataAccess>();
            var schemes = new[]
            {
                FakeSchemeData()
            };

            schemesDbSet = helper.GetAsyncEnabledDbSet(schemes);

            context = A.Fake <WeeeContext>();
            A.CallTo(() => context.Schemes).Returns(schemesDbSet);
            A.CallTo(() => context.ProducerSubmissions).Returns(producersDbSet);
            A.CallTo(() => context.MemberUploads).Returns(memberUploadsDbSet);

            generator                       = A.Fake <IGenerateFromXml>();
            xmlValidator                    = A.Fake <IXMLValidator>();
            xmlChargeBandCalculator         = A.Fake <IXMLChargeBandCalculator>();
            totalChargeCalculator           = A.Fake <ITotalChargeCalculator>();
            totalChargeCalculatorDataAccess = A.Fake <ITotalChargeCalculatorDataAccess>();

            handler = new ProcessXMLFileHandler(context, permissiveAuthorization, xmlValidator, generator, xmlConverter, xmlChargeBandCalculator, producerSubmissionDataAccess, totalChargeCalculator, totalChargeCalculatorDataAccess);
        }
        public TotalChargeCalculatorTests()
        {
            xmlChargeBandCalculator = A.Fake <IXMLChargeBandCalculator>();
            xmlConverter            = A.Fake <IXmlConverter>();

            totalCharge = 0;
            file        = ProcessTestXmlFile();

            totalChargeCalculator = new TotalChargeCalculator(xmlChargeBandCalculator, xmlConverter);
        }
Esempio n. 3
0
 public ProcessXMLFileHandler(WeeeContext context, IWeeeAuthorization authorization,
                              IXMLValidator xmlValidator, IGenerateFromXml generateFromXml, IXmlConverter xmlConverter,
                              IXMLChargeBandCalculator xmlChargeBandCalculator, IProducerSubmissionDataAccess producerSubmissionDataAccess, ITotalChargeCalculator totalChargeCalculator, ITotalChargeCalculatorDataAccess totalChargeCalculatorDataAccess)
 {
     this.context                         = context;
     this.authorization                   = authorization;
     this.xmlValidator                    = xmlValidator;
     this.xmlConverter                    = xmlConverter;
     this.xmlChargeBandCalculator         = xmlChargeBandCalculator;
     this.generateFromXml                 = generateFromXml;
     this.producerSubmissionDataAccess    = producerSubmissionDataAccess;
     this.totalChargeCalculator           = totalChargeCalculator;
     this.totalChargeCalculatorDataAccess = totalChargeCalculatorDataAccess;
 }
        public ProcessXMLFileHandlerTests()
        {
            memberUploadsDbSet = A.Fake<DbSet<MemberUpload>>();
            producersDbSet = A.Fake<DbSet<ProducerSubmission>>();
            xmlConverter = A.Fake<IXmlConverter>();
            producerSubmissionDataAccess = A.Fake<IProducerSubmissionDataAccess>();
            var schemes = new[]
            {
                FakeSchemeData()
            };

            schemesDbSet = helper.GetAsyncEnabledDbSet(schemes);

            context = A.Fake<WeeeContext>();
            A.CallTo(() => context.Schemes).Returns(schemesDbSet);
            A.CallTo(() => context.ProducerSubmissions).Returns(producersDbSet);
            A.CallTo(() => context.MemberUploads).Returns(memberUploadsDbSet);

            generator = A.Fake<IGenerateFromXml>();
            xmlValidator = A.Fake<IXMLValidator>();
            xmlChargeBandCalculator = A.Fake<IXMLChargeBandCalculator>();
            handler = new ProcessXMLFileHandler(context, permissiveAuthorization, xmlValidator, generator, xmlConverter, xmlChargeBandCalculator, producerSubmissionDataAccess);
        }
Esempio n. 5
0
 public TotalChargeCalculator(IXMLChargeBandCalculator xmlChargeBandCalculator, IXmlConverter xmlConverter)
 {
     this.xmlChargeBandCalculator = xmlChargeBandCalculator;
     this.xmlConverter            = xmlConverter;
 }