public void SendWindowsPhoneToastPushNotificationMessageTest()
        {
            var message = WindowsPhonePushNotificationMessageUnitTest.GetValidWindowsPhoneToastPushNotificationMessage();

            var result = PushNotifier.SendPushNotificationMessage(message);

            WindowsPhonePushNotificationMessageUnitTest.AssertOperationResultValidationResultsMessageCodeOnPushNotificationSendResult(result, ResultType.Success, true, true);
        }
        public void WindowsPhoneToastPushNotificationMessageParamLengthGreaterThan256Test()
        {
            var message = WindowsPhonePushNotificationMessageUnitTest.GetValidWindowsPhoneToastPushNotificationMessage();

            message.Param = "/MainPage.xaml?v=" + new String('a', 256);

            var result = PushNotifier.SendPushNotificationMessage(message);

            WindowsPhonePushNotificationMessageUnitTest.AssertOperationResultValidationResultsMessageCodeOnPushNotificationSendResult(result, ResultType.Success, false, false, "0003");
        }
        public void WindowsPhonePushNotificationMessageMessagePriorityNoneTest()
        {
            var message = WindowsPhonePushNotificationMessageUnitTest.GetValidWindowsPhoneToastPushNotificationMessage();

            message.MessagePriority = MessagePriority.None;

            var result = PushNotifier.SendPushNotificationMessage(message);

            WindowsPhonePushNotificationMessageUnitTest.AssertOperationResultValidationResultsMessageCodeOnPushNotificationSendResult(result, ResultType.Success, false, false, "0011");
        }
        public void WindowsPhonePushNotificationMessageNotificationUriNullTest()
        {
            var message = WindowsPhonePushNotificationMessageUnitTest.GetValidWindowsPhoneToastPushNotificationMessage();

            message.NotificationUri = null;

            var result = PushNotifier.SendPushNotificationMessage(message);

            WindowsPhonePushNotificationMessageUnitTest.AssertOperationResultValidationResultsMessageCodeOnPushNotificationSendResult(result, ResultType.Success, false, false, "0010");
        }
        public void WindowsPhoneToastPushNotificationMessageParamForWindowsPhone7_0Test()
        {
            var message = WindowsPhonePushNotificationMessageUnitTest.GetValidWindowsPhoneToastPushNotificationMessage();

            message.SupportWindowsPhone7_0 = true;
            message.Param = "/MainPage.xaml";

            var result = PushNotifier.SendPushNotificationMessage(message);

            WindowsPhonePushNotificationMessageUnitTest.AssertOperationResultValidationResultsMessageCodeOnPushNotificationSendResult(result, ResultType.Success, false, true, "0004");
        }
        public void WindowsPhonePushNotificationMessageX509CertificateNullTest()
        {
            var message = WindowsPhonePushNotificationMessageUnitTest.GetValidWindowsPhoneToastPushNotificationMessage();

            message.AuthenticationSettings = new WindowsPhoneAuthenticationSettings()
            {
                EnableAuthentication = true,
                X509Certificate      = null,
            };

            var result = PushNotifier.SendPushNotificationMessage(message);

            WindowsPhonePushNotificationMessageUnitTest.AssertOperationResultValidationResultsMessageCodeOnPushNotificationSendResult(result, ResultType.Success, false, false, "0009");
        }
        public void SendAsyncWindowsPhoneToastPushNotificationMessageTest()
        {
            var returned = false;
            var message  = WindowsPhonePushNotificationMessageUnitTest.GetValidWindowsPhoneToastPushNotificationMessage();

            PushNotifier.SendPushNotificationMessageAsync(message, (result) =>
            {
                WindowsPhonePushNotificationMessageUnitTest.AssertOperationResultValidationResultsMessageCodeOnPushNotificationSendResult(result, ResultType.Success, true, true);
                returned = true;
            });

            while (!returned)
            {
                System.Threading.Thread.Sleep(500);
            }
        }