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); }
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); }
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); }
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); }
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); } }
private void SentNotification(Item item) { PushoverClient client = new PushoverClient(this.AppApiKey); client.SendAsync(this.UserApiKey, item.Content, item.Title, new Uri(item.Url)); }