Exemple #1
0
        public void Can_Trigger_Two_Emails_Without_Having_RecipientsCollections_Combining()
        {
            // check configuration to see if we want to do this
            if (!bool.Parse(ConfigurationManager.AppSettings["sendTestEmail"]))
            {
                Assert.Ignore("Skipping test");
            }

            //// Arrange
            var monitor = new OrderConfirmationMonitor(MerchelloContext.Current.Gateways.Notification);

            var invoice = MockInvoiceDataMaker.GetMockInvoiceForTaxation();

            MerchelloContext.Current.Services.InvoiceService.Save(invoice);

            var paymentMethods = MerchelloContext.Current.Gateways.Payment.GetPaymentGatewayMethods().ToArray();

            Assert.IsTrue(paymentMethods.Any(), "There are no payment methods");


            var paymentResult = invoice.AuthorizeCapturePayment(
                MerchelloContext.Current,
                paymentMethods.FirstOrDefault().PaymentMethod.Key,
                new ProcessorArgumentCollection());

            //// Act
            var contact1 = "[email1]";

            Notification.Trigger("OrderConfirmation", paymentResult, new [] { contact1 });

            var contact2 = "[email2]";

            Notification.Trigger("OrderConfirmation", paymentResult, new [] { contact2 });
        }
        public void Can_Simulate_A_TriggeredOrderConfirmation()
        {
            // check configuration to see if we want to do this
            if (!bool.Parse(ConfigurationManager.AppSettings["sendTestEmail"])) Assert.Ignore("Skipping test");

            //// Arrange
            var monitor = new OrderConfirmationMonitor(MerchelloContext.Current.Gateways.Notification);

            var invoice = MockInvoiceDataMaker.GetMockInvoiceForTaxation();
            MerchelloContext.Current.Services.InvoiceService.Save(invoice);

            var paymentMethods = MerchelloContext.Current.Gateways.Payment.GetPaymentGatewayMethods().ToArray();
            Assert.IsTrue(paymentMethods.Any(), "There are no payment methods");

            var paymentResult = invoice.AuthorizeCapturePayment(
                MerchelloContext.Current,
                paymentMethods.FirstOrDefault().PaymentMethod.Key,
                new ProcessorArgumentCollection());

            //// Act
            Notification.Trigger("OrderConfirmation", paymentResult, new [] { "*****@*****.**" });
            Notification.Trigger("OrderConfirmation", paymentResult, new[] { "*****@*****.**" });

            //// Assert

            // check email
        }
Exemple #3
0
        public void Can_Simulate_A_TriggeredOrderConfirmation()
        {
            // check configuration to see if we want to do this
            if (!bool.Parse(ConfigurationManager.AppSettings["sendTestEmail"]))
            {
                Assert.Ignore("Skipping test");
            }

            //// Arrange
            var monitor = new OrderConfirmationMonitor(MerchelloContext.Current.Gateways.Notification);

            var invoice = MockInvoiceDataMaker.GetMockInvoiceForTaxation();

            MerchelloContext.Current.Services.InvoiceService.Save(invoice);

            var paymentMethods = MerchelloContext.Current.Gateways.Payment.GetPaymentGatewayMethods().ToArray();

            Assert.IsTrue(paymentMethods.Any(), "There are no payment methods");


            var paymentResult = invoice.AuthorizeCapturePayment(
                MerchelloContext.Current,
                paymentMethods.FirstOrDefault().PaymentMethod.Key,
                new ProcessorArgumentCollection());

            //// Act
            Notification.Trigger("OrderConfirmation", paymentResult, new [] { "*****@*****.**" });
            Notification.Trigger("OrderConfirmation", paymentResult, new[] { "*****@*****.**" });

            //// Assert

            // check email
        }
        public void Can_Trigger_Two_Emails_Without_Having_RecipientsCollections_Combining()
        {
            // check configuration to see if we want to do this
            if (!bool.Parse(ConfigurationManager.AppSettings["sendTestEmail"])) Assert.Ignore("Skipping test");

            //// Arrange
            var monitor = new OrderConfirmationMonitor(MerchelloContext.Current.Gateways.Notification);

            var invoice = MockInvoiceDataMaker.GetMockInvoiceForTaxation();
            MerchelloContext.Current.Services.InvoiceService.Save(invoice);

            var paymentMethods = MerchelloContext.Current.Gateways.Payment.GetPaymentGatewayMethods().ToArray();
            Assert.IsTrue(paymentMethods.Any(), "There are no payment methods");

            var paymentResult = invoice.AuthorizeCapturePayment(
                MerchelloContext.Current,
                paymentMethods.FirstOrDefault().PaymentMethod.Key,
                new ProcessorArgumentCollection());

            //// Act
            var contact1 = "[email1]";
            Notification.Trigger("OrderConfirmation", paymentResult, new [] {contact1});

            var contact2 = "[email2]";
            Notification.Trigger("OrderConfirmation", paymentResult, new [] {contact2});
        }