public void SendVersionedPushNotificationToDeviceWithoutWithInvalidVersionTest()
        {
            NotificationTest        test    = new NotificationTest();
            PushNotificationChannel channel = new PushNotificationChannel(this.CreateMobileServiceClient(), test.EventPublisher);

            PushNotification           notification = this.CreateNotification(new Version(1, 0, 0));
            NotificationAccount <Guid> account      = test.AddNotificationAccount(Guid.NewGuid(), mobileAppVersion: "Invalid");

            channel.SendAsync(account, notification).Wait();

            this.AssertSentFailed(test, account, notification, NotificationErrorCode.VersionMismatch);
        }
        public void SendPushNotificationForAnOutdatedVersionOfTheApplicationTest()
        {
            NotificationTest        test    = new NotificationTest();
            PushNotificationChannel channel = new PushNotificationChannel(this.CreateMobileServiceClient(), test.EventPublisher);

            PushNotification           notification = this.CreateNotification(new Version(1, 0, 0), new Version(1, 0, 2));
            NotificationAccount <Guid> account      = test.AddNotificationAccount(Guid.NewGuid(), mobileAppVersion: "1.0.3");

            channel.SendAsync(account, notification).Wait();

            this.AssertSentFailed(test, account, notification, NotificationErrorCode.VersionMismatch);
        }
        public void SendPushNotificationWithOnlyMinimumAppVersionSpecifiedTest()
        {
            NotificationTest        test    = new NotificationTest();
            PushNotificationChannel channel = new PushNotificationChannel(this.CreateMobileServiceClient(), test.EventPublisher);

            PushNotification           notification = this.CreateNotification(new Version(1, 0, 0));
            NotificationAccount <Guid> account      = test.AddNotificationAccount(Guid.NewGuid(), mobileAppVersion: "1.0.3");

            channel.SendAsync(account, notification).Wait();

            this.AssertSentSuccessful(test, account, notification);
        }
        public void SendPushNotificationForAccountWithoutMobileDeviceTest()
        {
            NotificationTest        test    = new NotificationTest();
            PushNotificationChannel channel = new PushNotificationChannel(this.CreateMobileServiceClient(), test.EventPublisher);

            PushNotification           notification = this.CreateNotification();
            NotificationAccount <Guid> account      = test.AddNotificationAccount(Guid.NewGuid(), "*****@*****.**", "Joe", null, (MobileDevice)null);

            channel.SendAsync(account, notification).Wait();

            this.AssertSentFailed(test, account, notification, NotificationErrorCode.MobileDeviceNotRegistered);
        }
        public void SendInvalidEndPointPushNotificationTest()
        {
            NotificationTest test = new NotificationTest();
            IMobilePushNotificationServiceClient mobileServiceClient = this.CreateMobileServiceClient();
            PushNotificationChannel channel = new PushNotificationChannel(mobileServiceClient, test.EventPublisher);

            PushNotification           notification = this.CreateNotification();
            NotificationAccount <Guid> account      = test.AddNotificationAccount();

            this.PushNotificationShouldFailAtEndPoint(mobileServiceClient);

            channel.SendAsync(account, notification).Wait();

            this.AssertSentFailed(test, account, notification, NotificationErrorCode.RouteFailure);
        }