示例#1
0
        public void GetNotifierShouldReturnUsergridNotifierFromEntityManager()
        {
            var entity = new UsergridNotifier();

            _entityManager.GetEntity <UsergridNotifier>("/notifiers", "notifierIdentifier").Returns(x => entity);

            var returnedEntity = _client.GetNotifier <UsergridNotifier>("notifierIdentifier");

            Assert.AreEqual(entity, returnedEntity);
        }
示例#2
0
        public void ShouldCreateNotifierForAndroid()
        {
            const string notifierName = "test_notifier";
            var          client       = InitializeClientAndLogin(AuthType.Organization);

            DeleteNotifierIfExists(client, notifierName);

            client.CreateNotifierForAndroid(notifierName, GoogleApiKey /*e.g. AIzaSyCkXOtBQ7A9GoJsSLqZlod_YjEfxxxxxxx*/);

            UsergridNotifier usergridNotifier = client.GetNotifier <UsergridNotifier>(notifierName);

            Assert.That(usergridNotifier, Is.Not.Null);
            Assert.That(usergridNotifier.Provider, Is.EqualTo("google"));
            Assert.That(usergridNotifier.Name, Is.EqualTo(notifierName));
        }
示例#3
0
        public void ShouldCreateNotifierForApple()
        {
            const string notifierName = "test_notifier";
            const string environment  = "development";
            var          client       = InitializeClientAndLogin(AuthType.Organization);

            DeleteNotifierIfExists(client, notifierName);

            client.CreateNotifierForApple(notifierName, environment, P12CertificatePath /*e.g. c:\temp\pushtest_dev.p12*/);

            UsergridNotifier usergridNotifier = client.GetNotifier <UsergridNotifier>(notifierName);

            Assert.That(usergridNotifier, Is.Not.Null);
            Assert.That(usergridNotifier.Environment, Is.EqualTo(environment));
            Assert.That(usergridNotifier.Provider, Is.EqualTo("apple"));
            Assert.That(usergridNotifier.Name, Is.EqualTo(notifierName));
        }