public void LiveTest() { DatabaseSendTableFromMailrelay databaseSendTableFromMailrelay = CreateDatabaseSendTableFromMailrelay(); //databaseSendTableFromMailrelay.limitOnDateName = "createdon"; SendTableFromMailrelay sendTableFromMailrelay = new SendTableFromMailrelay(Connection, databaseSendTableFromMailrelay); sendTableFromMailrelay.ExecuteOption(new Administration.Option.Options.OptionReport(typeof(SendTableFromMailrelayTest))); }
public void MailCanBeLimitedOnId() { DatabaseSendTableFromMailrelay databaseSendTableFromMailrelay = CreateDatabaseSendTableFromMailrelay(); databaseSendTableFromMailrelay.sendType = DatabaseSendTableFromMailrelay.SendTypeEnum.Smtp; databaseSendTableFromMailrelay.contactid = Guid.Parse("b238f6be-5510-e611-80e9-001c42fd47a5"); databaseSendTableFromMailrelay.contactidName = "accountid"; databaseSendTableFromMailrelay.toEmail = "*****@*****.**"; databaseSendTableFromMailrelay.fromEmail = "*****@*****.**"; SendTableFromMailrelay sendTableFromMailrelay = new SendTableFromMailrelay(Connection, databaseSendTableFromMailrelay); sendTableFromMailrelay.ChangeMailrelayConnection(_mailrelayConnectionTester); SystemInterface.Email.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.SpecifiedPickupDirectory; SystemInterface.Email.PickupDirectoryLocation = "c:\\test\\email"; sendTableFromMailrelay.ExecuteOption(new Administration.Option.Options.OptionReport(typeof(SendTableFromMailrelayTest))); }
public void MissingEmailOrFullnameWillNotBreakExecute() { DatabaseSendTableFromMailrelay databaseSendTableFromMailrelay = CreateDatabaseSendTableFromMailrelay(); databaseSendTableFromMailrelay.limitOnDateName = "createdon"; SendTableFromMailrelay sendTableFromMailrelay = new SendTableFromMailrelay(Connection, databaseSendTableFromMailrelay); sendTableFromMailrelay.ChangeMailrelayConnection(_mailrelayConnectionTester); sendTableFromMailrelay.SetDynamicsCrmConnectionIfEmpty(_dynamicsCrmConnectionTester); EnqueueCrmResponse(new List <DateTime>() { new DateTime(2000, 1, 1), new DateTime(2000, 1, 2), DateTime.Now.Date.AddHours(-3) }, false, false); _mailrelayConnectionTester.replies.Enqueue(new MailrelayBoolReply()); sendTableFromMailrelay.ExecuteOption(new Administration.Option.Options.OptionReport(typeof(SendTableFromMailrelayTest))); }
public void MailCanBeSendtToBykoordinator() { DatabaseSendTableFromMailrelay databaseSendTableFromMailrelay = CreateDatabaseSendTableFromMailrelay(mailTypeEnum.bykoordinator); databaseSendTableFromMailrelay.limitOnDateName = "createdon"; databaseSendTableFromMailrelay.sendType = DatabaseSendTableFromMailrelay.SendTypeEnum.Smtp; databaseSendTableFromMailrelay.fromEmail = "*****@*****.**"; SendTableFromMailrelay sendTableFromMailrelay = new SendTableFromMailrelay(Connection, databaseSendTableFromMailrelay); sendTableFromMailrelay.ChangeMailrelayConnection(_mailrelayConnectionTester); //sendTableFromMailrelay.SetDynamicsCrmConnectionIfEmpty(_dynamicsCrmConnectionTester); //EnqueueCrmResponse(new List<DateTime>() { new DateTime(2000, 1, 1), DateTime.Now, new DateTime(2000, 1, 2), new DateTime(2000, 1, 3), DateTime.Now.AddDays(-1) }); SystemInterface.Email.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.SpecifiedPickupDirectory; SystemInterface.Email.PickupDirectoryLocation = "c:\\test\\email"; sendTableFromMailrelay.ExecuteOption(new Administration.Option.Options.OptionReport(typeof(SendTableFromMailrelayTest))); }
public void FailedSendWillNotRetry() { DatabaseSendTableFromMailrelay databaseSendTableFromMailrelay = CreateDatabaseSendTableFromMailrelay(); databaseSendTableFromMailrelay.limitOnDateName = "createdon"; SendTableFromMailrelay sendTableFromMailrelay = new SendTableFromMailrelay(Connection, databaseSendTableFromMailrelay); sendTableFromMailrelay.ChangeMailrelayConnection(_mailrelayConnectionTester); sendTableFromMailrelay.SetDynamicsCrmConnectionIfEmpty(_dynamicsCrmConnectionTester); EnqueueCrmResponse(new List <DateTime>() { new DateTime(2000, 1, 1), new DateTime(2000, 1, 2), DateTime.Now.Date.AddHours(-3) }); Administration.Option.Options.OptionReport report = new Administration.Option.Options.OptionReport(typeof(SendTableFromMailrelayTest)); sendTableFromMailrelay.ExecuteOption(report); bool succeded = report.Success; Assert.IsTrue(succeded); }
public void MailCanBeSendt() { DatabaseSendTableFromMailrelay databaseSendTableFromMailrelay = CreateDatabaseSendTableFromMailrelay(); databaseSendTableFromMailrelay.limitOnDateName = "createdon"; SendTableFromMailrelay sendTableFromMailrelay = new SendTableFromMailrelay(Connection, databaseSendTableFromMailrelay); sendTableFromMailrelay.ChangeMailrelayConnection(_mailrelayConnectionTester); sendTableFromMailrelay.SetDynamicsCrmConnectionIfEmpty(_dynamicsCrmConnectionTester); EnqueueCrmResponse(new List <DateTime>() { new DateTime(2000, 1, 1), DateTime.Now, new DateTime(2000, 1, 2), new DateTime(2000, 1, 3), DateTime.Now.AddDays(-1) }); _mailrelayConnectionTester.replies.Enqueue(new MailrelayBoolReply()); sendTableFromMailrelay.ExecuteOption(new Administration.Option.Options.OptionReport(typeof(SendTableFromMailrelayTest))); sendMail sendMailFunction = (sendMail)_mailrelayConnectionTester.sendFunctions.Single(function => function is sendMail); Console.Out.WriteLine(sendMailFunction.html); }
public void MailWillNotBeSentIfLimitedOnDate() { DatabaseSendTableFromMailrelay databaseSendTableFromMailrelay = CreateDatabaseSendTableFromMailrelay(); databaseSendTableFromMailrelay.limitOnDateName = "createdon"; SendTableFromMailrelay sendTableFromMailrelay = new SendTableFromMailrelay(Connection, databaseSendTableFromMailrelay); sendTableFromMailrelay.ChangeMailrelayConnection(_mailrelayConnectionTester); sendTableFromMailrelay.SetDynamicsCrmConnectionIfEmpty(_dynamicsCrmConnectionTester); EnqueueCrmResponse(new List <DateTime>() { new DateTime(2000, 1, 1), new DateTime(2000, 1, 2), new DateTime(2000, 1, 3) }); _mailrelayConnectionTester.replies.Enqueue(new MailrelayBoolReply()); sendTableFromMailrelay.ExecuteOption(new Administration.Option.Options.OptionReport(typeof(SendTableFromMailrelayTest))); sendMail sendMailFunction = (sendMail)_mailrelayConnectionTester.sendFunctions.SingleOrDefault(function => function is sendMail); Assert.IsNull(sendMailFunction); }