コード例 #1
0
        public void TestDeleteNotificationPreference()
        {
            Moip.Models.NotificationPreferenceRequest notificationPreferenceRequest = Helpers.RequestsCreator.CreateNotificationRequest();

            string notificationPreferenceId = controller.CreateNotificationPreference(notificationPreferenceRequest).Id;

            bool notificationPreferenceResponse = controller.DeleteNotificationPreference(notificationPreferenceId);

            Assert.IsTrue(notificationPreferenceResponse, "Should be true when deleting a notification preference");
        }
コード例 #2
0

        
コード例 #3
0
        public void TestCreateNotificationPreference()
        {
            Moip.Models.NotificationPreferenceRequest notificationPreferenceRequest = Helpers.RequestsCreator.CreateNotificationRequest();

            Moip.Models.NotificationPreferenceResponse notificationPreferenceResponse = controller.CreateNotificationPreference(notificationPreferenceRequest);

            Assert.NotNull(notificationPreferenceResponse.Id, "Id should not be null");
            Assert.AreEqual("WEBHOOK", notificationPreferenceResponse.Media, "Should match exactly (string literal match)");
            Assert.AreEqual("ORDER.*", notificationPreferenceResponse.Events[0], "Should match exactly (string literal match)");
            Assert.AreEqual("PAYMENT.AUTHORIZED", notificationPreferenceResponse.Events[1], "Should match exactly (string literal match)");
            Assert.AreEqual("PAYMENT.CANCELLED", notificationPreferenceResponse.Events[2], "Should match exactly (string literal match)");
        }
コード例 #4
0
        public static Moip.Models.NotificationPreferenceRequest CreateNotificationRequest()
        {
            List <string> eventsList = new List <string>();

            eventsList.Add("ORDER.*");
            eventsList.Add("PAYMENT.AUTHORIZED");
            eventsList.Add("PAYMENT.CANCELLED");

            Moip.Models.NotificationPreferenceRequest notificationPreferenceRequest = new Moip.Models.NotificationPreferenceRequest()
            {
                Events = eventsList,
                Target = "http://requestb.in/1dhjesw1",
                Media  = "WEBHOOK"
            };
            return(notificationPreferenceRequest);
        }