コード例 #1
0
        public async Task Send_With_Sound_Got_Ok()
        {
            var client = new PushoverClient(ApiKey);

            var message  = client.NewMessageWithSound("Hello world", Sound.CashRegister);
            var response = await client.SendAsync(message, UserKey);

            Assert.Equal(response.StatusCode, HttpStatusCode.OK);
        }
コード例 #2
0
        public async Task Send_Default_Got_Ok()
        {
            var client = new PushoverClient(ApiKey);

            var message  = client.NewMessage("Hello world");
            var response = await client.SendAsync(message, UserKey);

            Assert.Equal(response.StatusCode, HttpStatusCode.OK);
        }
コード例 #3
0
        public async Task Send_With_Sound_Got_Ok()
        {
            var client = new PushoverClient(string.Empty);

            PushoverClient.HttpHandler = new MockHandler();

            var message  = client.NewMessageWithSound("Hello world", Sound.CashRegister);
            var response = await client.SendAsync(message, string.Empty);

            Assert.Equal(response.StatusCode, HttpStatusCode.OK);
        }
コード例 #4
0
        public async Task Send_Default_Got_Ok()
        {
            var client = new PushoverClient(string.Empty);

            PushoverClient.HttpHandler = new MockHandler();

            var message  = client.NewMessage("Hello world");
            var response = await client.SendAsync(message, string.Empty);

            Assert.Equal(response.StatusCode, HttpStatusCode.OK);
        }
コード例 #5
0
        public async Task Send_Multiple_Got_Ok()
        {
            var client = new PushoverClient(ApiKey);

            var message   = client.NewMessage("Hello world");
            var responses = await client.SendAsync(message, UserKey, UserKey);

            foreach (var response in responses)
            {
                Assert.Equal(response.StatusCode, HttpStatusCode.OK);
            }
        }
コード例 #6
0
ファイル: Service.cs プロジェクト: philphilphil/RSS2Pushover
        private void SentNotification(Item item)
        {
            PushoverClient client = new PushoverClient(this.AppApiKey);

            client.SendAsync(this.UserApiKey, item.Content, item.Title, new Uri(item.Url));
        }