Example #1
0
		internal static IMessageBuilder GetApplicationMessageBuilder(
			IDbConnection connection,
			string mainConnectionString,
			string filesConnectionString)
		{
			var serializer = new Serializer();
			var passwordConverter = new PasswordConverter();
			var mainExecutor = new SqlProcedureExecutor(mainConnectionString);
			var filesExecutor = new SqlProcedureExecutor(filesConnectionString);
			var states = new StateRepository(mainExecutor);
			var applications = new ApplicationRepository(connection);
			var awbs = new AwbRepository(connection);
			var applicationFiles = new ApplicationFileRepository(filesExecutor);
			var clientRepository = new ClientRepository(mainExecutor);
			var clientBalanceRepository = new ClientBalanceRepository(mainExecutor);
			var countries = new CountryRepository(mainExecutor);
			var cities = new CityRepository(mainExecutor);
			var textBulder = new Application.Helpers.TextBuilder(
				serializer,
				awbs,
				countries,
				cities,
				states,
				applicationFiles,
				clientBalanceRepository,
				new TextBuilder());
			var templates = new TemplateRepository(mainExecutor);
			var recipientsFacade = new ApplicationEventRecipientsFacade(
				awbs,
				applications,
				new AdminRepository(connection),
				new ManagerRepository(connection),
				new SenderRepository(passwordConverter, mainExecutor),
				clientRepository,
				new CarrierRepository(passwordConverter, mainExecutor),
				new ForwarderRepository(passwordConverter, mainExecutor),
				new BrokerRepository(connection),
				new EventEmailRecipient(mainExecutor));
			var templateRepositoryHelper = new TemplateRepositoryHelper(templates);

			var filesFacade = GetFilesFacade(connection, mainConnectionString, filesConnectionString);

			return new ApplicationMessageBuilder(
				EmailsHelper.DefaultFrom,
				filesFacade,
				textBulder,
				recipientsFacade,
				templateRepositoryHelper,
				serializer,
				applications);
		}
		public void TestInitialize()
		{
			_container = new MockContainer();

			_templateRepositoryHelper = _container.Create<TemplateRepositoryHelper>();
		}
Example #3
0
		private static IMessageBuilder GetCommonMessageBuilder(
			IDbConnection connection,
			string mainConnectionString,
			string filesConnectionString,
			ILocalizedDataHelper localizedDataHelper,
			IRecipientsFacade recipientsFacade)
		{
			var executor = new SqlProcedureExecutor(mainConnectionString);
			var templateRepository = new TemplateRepository(executor);
			var textBuilder = new TextBuilder();
			var templateRepositoryWrapper = new TemplateRepositoryHelper(templateRepository);
			var filesFacade = GetFilesFacade(connection, mainConnectionString, filesConnectionString);

			return new CommonEventMessageBuilder(
				EmailsHelper.DefaultFrom,
				recipientsFacade,
				new Serializer(),
				textBuilder,
				localizedDataHelper,
				templateRepositoryWrapper,
				filesFacade);
		}