Пример #1
0
		public void TestInitialize()
		{
			_context = new MockContainer();
			_context.SenderRepository.Setup(x => x.GetByUserId(TestConstants.TestAdminUserId)).Returns((long?)null);
			var configuration = new MailConfiguration();
			_sender = new MailSender(configuration);
			_mailFolder = configuration.GetConfiguration(TestConstants.TestAdminUserId)
				.SpecifiedPickupDirectory
				.PickupDirectoryLocation;

			if(Directory.Exists(_mailFolder))
			{
				foreach(var file in Directory.EnumerateFiles(_mailFolder))
				{
					File.Delete(file);
				}
			}
		}
Пример #2
0
		private static void RunMailSenderJob(string connectionString, int partitionId)
		{
			var serializer = new Serializer();
			var executor = new SqlProcedureExecutor(connectionString);
			var messages = new EmailMessageRepository(executor);
			var mailConfiguration = new MailConfiguration();
			var sender = new MailSender(mailConfiguration);

			var job = new MailSenderJob(messages, partitionId, sender, serializer);

			job.Work();
		}