예제 #1
0
        public PAFImport(IPAFFileProcessUtility pafLoader, ILoggingHelper loggingHelper, IConfigurationHelper configurationHelper)
        {
            this.pafLoader           = pafLoader;
            this.loggingHelper       = loggingHelper;
            this.configurationHelper = configurationHelper;

            this.ServiceName = configurationHelper.ReadAppSettingsConfigurationValues(BatchServiceName);
            this.processed   = configurationHelper.ReadAppSettingsConfigurationValues(PAFProcessedFilePath);
            this.error       = configurationHelper.ReadAppSettingsConfigurationValues(PAFErrorFilePath);
        }
예제 #2
0
        protected override void OnSetup()
        {
            msgBrokerMock           = CreateMock <IMessageBroker <PostalAddressDTO> >();
            loggingHelperMock       = CreateMock <ILoggingHelper>();
            configurationHelperMock = CreateMock <IConfigurationHelper>();
            configurationHelperMock.Setup(x => x.ReadAppSettingsConfigurationValues("PAFProcessedFilePath")).Returns("d:/processedfile/");
            configurationHelperMock.Setup(x => x.ReadAppSettingsConfigurationValues("PAFErrorFilePath")).Returns("d:/errorfile/");
            configurationHelperMock.Setup(x => x.ReadAppSettingsConfigurationValues(PAFLoaderConstants.NoOfCharactersForPAF)).Returns("19");
            configurationHelperMock.Setup(x => x.ReadAppSettingsConfigurationValues(PAFLoaderConstants.MaxCharactersForPAF)).Returns("534");
            configurationHelperMock.Setup(x => x.ReadAppSettingsConfigurationValues(PAFLoaderConstants.CsvPAFValues)).Returns("20");
            testCandidate = new PAFFileProcessUtility(msgBrokerMock.Object, configurationHelperMock.Object, loggingHelperMock.Object);

            var rmTraceManagerMock = new Mock <IRMTraceManager>();

            rmTraceManagerMock.Setup(x => x.StartTrace(It.IsAny <string>(), It.IsAny <Guid>()));
            loggingHelperMock.Setup(x => x.RMTraceManager).Returns(rmTraceManagerMock.Object);
        }
예제 #3
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        private static void Main()
        {
            IKernel kernel = new StandardKernel(new StartUp());

            IPAFFileProcessUtility pafLoader           = kernel.Get <IPAFFileProcessUtility>();
            ILoggingHelper         loggingHelper       = kernel.Get <ILoggingHelper>();
            IConfigurationHelper   configurationHelper = kernel.Get <IConfigurationHelper>();

#if DEBUG
            using (PAFImport myService = new PAFImport(pafLoader, loggingHelper, configurationHelper))
            {
                myService.OnDebug();
                System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            }
#else
            ServiceBase[] servicesToRun = new ServiceBase[] { new PAFImport(pafLoader, loggingHelper, configurationHelper) };
            ServiceBase.Run(servicesToRun);
#endif
        }