remove AlertType.Unknown, update tests
This commit is contained in:
@@ -64,8 +64,7 @@ namespace UptimeSharp.Tests
|
||||
|
||||
Assert.Equal(2, specificAlerts.Count);
|
||||
|
||||
await client.DeleteAlert(alerts[0]);
|
||||
await client.DeleteAlert(alerts[1]);
|
||||
await ResetAlerts();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,5 +83,18 @@ namespace UptimeSharp.Tests
|
||||
|
||||
return origin;
|
||||
}
|
||||
|
||||
|
||||
private async Task ResetAlerts()
|
||||
{
|
||||
try
|
||||
{
|
||||
List<Alert> alerts = await client.GetAlerts();
|
||||
await client.DeleteAlert(alerts[0]);
|
||||
await client.DeleteAlert(alerts[1]);
|
||||
await client.DeleteAlert(alerts[2]);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,13 +59,11 @@ namespace UptimeSharp
|
||||
throw new UptimeSharpException("AlertType.SMS and AlertType.Twitter are not supported by the UptimeRobot API");
|
||||
}
|
||||
|
||||
AddAlertResponse response = await Request<AddAlertResponse>("newAlertContact", cancellationToken, new Dictionary<string, string>()
|
||||
Alert alert = (await Request<AddAlertResponse>("newAlertContact", cancellationToken, new Dictionary<string, string>()
|
||||
{
|
||||
{ "alertContactType", ((int)type).ToString() },
|
||||
{ "alertContactValue", value }
|
||||
});
|
||||
|
||||
Alert alert = response.Alert;
|
||||
})).Alert;
|
||||
|
||||
if (alert != null)
|
||||
{
|
||||
|
||||
@@ -99,10 +99,6 @@ namespace UptimeSharp.Models
|
||||
/// </summary>
|
||||
public enum AlertStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// Unknown
|
||||
/// </summary>
|
||||
Unknown,
|
||||
/// <summary>
|
||||
/// Not activated
|
||||
/// </summary>
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<Compile Include="Models\Parameters\MonitorParameters.cs" />
|
||||
<Compile Include="Models\Parameters\Parameters.cs" />
|
||||
<Compile Include="Models\Parameters\RetrieveParameters.cs" />
|
||||
<Compile Include="Models\Response\AddAlertResonse.cs" />
|
||||
<Compile Include="Models\Response\AlertResponse.cs" />
|
||||
<Compile Include="Models\Response\DefaultResponse.cs" />
|
||||
<Compile Include="Models\Response\IResponse.cs" />
|
||||
|
||||
Reference in New Issue
Block a user