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); }
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); }
/// <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 }