Skip to content

Commit

Permalink
Merge pull request #267 from Vonage/dev
Browse files Browse the repository at this point in the history
Dev into Main for Release
  • Loading branch information
matt-lethargic committed Apr 20, 2022
2 parents ef3761a + 857c132 commit cd3c53a
Show file tree
Hide file tree
Showing 50 changed files with 1,319 additions and 204 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core.yml
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches: [ main, dev ]

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion Nexmo.Api.Test.Unit/Nexmo.Api.Test.Unit.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;net46;net461;net462;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;net47;net471;net472;net48;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net452;net46;net462;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;net47;net471;net472;net48;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<NoWarn>1701;1702;0618</NoWarn>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;ReleaseSigned</Configurations>
Expand Down
6 changes: 5 additions & 1 deletion Vonage.Test.Unit/AccountTest.cs
Expand Up @@ -377,7 +377,11 @@ public void CreateApiSecret(bool passCreds)
//ASSERT
Assert.Equal("ad6dc56f-07b5-46e1-a527-85530e625800", secret.Id);
Assert.Equal("2017-03-02T16:34:49Z", secret.CreatedAt);
Assert.Equal("abc123", secret.Links.Self.Href);
Assert.Equal("abc123", secret.Links.Self.Href);
Assert.Null(secret.Links.Next);
Assert.Null(secret.Links.Prev);
Assert.Null(secret.Links.First);
Assert.Null(secret.Links.Last);
}

[Theory]
Expand Down
@@ -0,0 +1,9 @@
{
"message-count": "1",
"messages": [
{
"status": "4",
"error-text": "invalid credentials"
}
]
}
@@ -0,0 +1,14 @@
{
"message-count": "1",
"messages": [
{
"to": "447700900000",
"message-id": "0A0000000123ABCD1",
"status": "0",
"remaining-balance": "3.14159265",
"message-price": "0.03330000",
"network": "12345",
"account-ref": "customer1234"
}
]
}
9 changes: 9 additions & 0 deletions Vonage.Test.Unit/Data/MessagingTests/SendSmsBadResponse.json
@@ -0,0 +1,9 @@
{
"message-count": "1",
"messages": [
{
"status": "4",
"error-text": "invalid credentials"
}
]
}
@@ -0,0 +1,14 @@
{
"message-count": "1",
"messages": [
{
"to": "447700900000",
"message-id": "0A0000000123ABCD1",
"status": "0",
"remaining-balance": "3.14159265",
"message-price": "0.03330000",
"network": "12345",
"account-ref": "customer1234"
}
]
}
@@ -0,0 +1,14 @@
{
"message-count": "1",
"messages": [
{
"to": "447700900000",
"message-id": "0A0000000123ABCD1",
"status": "0",
"remaining-balance": "3.14159265",
"message-price": "0.03330000",
"network": "12345",
"account-ref": "customer1234"
}
]
}
@@ -0,0 +1,9 @@
{
"message-count": "1",
"messages": [
{
"status": "4",
"error-text": "invalid credentials"
}
]
}
2 changes: 2 additions & 0 deletions Vonage.Test.Unit/Data/RedactTests/Redact.json
@@ -0,0 +1,2 @@
{
}
2 changes: 2 additions & 0 deletions Vonage.Test.Unit/Data/RedactTests/RedactAsync.json
@@ -0,0 +1,2 @@
{
}
4 changes: 4 additions & 0 deletions Vonage.Test.Unit/Data/RedactTests/RedactReturns401.json
@@ -0,0 +1,4 @@
{
"type": "UNAUTHORIZED",
"error_title": "Unauthorized"
}
6 changes: 6 additions & 0 deletions Vonage.Test.Unit/Data/RedactTests/RedactReturns403.json
@@ -0,0 +1,6 @@
{
"type": "https://developer.nexmo.com/api-errors/redact#premature-redaction",
"title": "Premature Redaction",
"detail": "You must wait 60 minutes before redacting ID '0A000000B0C9A1234'",
"instance": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
}
6 changes: 6 additions & 0 deletions Vonage.Test.Unit/Data/RedactTests/RedactReturns404.json
@@ -0,0 +1,6 @@
{
"type": "https://developer.nexmo.com/api-errors#invalid-id",
"title": "Invalid ID",
"detail": "ID '0A000000B0C9A1234' could not be found (type=MT)",
"instance": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
}
6 changes: 6 additions & 0 deletions Vonage.Test.Unit/Data/RedactTests/RedactReturns422.json
@@ -0,0 +1,6 @@
{
"type": "https://developer.nexmo.com/api-errors#invalid-json",
"title": "Invalid JSON",
"detail": "Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries",
"instance": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
}
6 changes: 6 additions & 0 deletions Vonage.Test.Unit/Data/RedactTests/RedactReturns429.json
@@ -0,0 +1,6 @@
{
"type": "https://developer.nexmo.com/api-errors/redact#rate-limit",
"title": "Rate Limit Hit",
"detail": "Please wait, then retry your request",
"instance": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
}
6 changes: 6 additions & 0 deletions Vonage.Test.Unit/Data/ShortCodeTests/ManageOptIn.json
@@ -0,0 +1,6 @@
{
"msisdn": "15559301529",
"opt-in": "true",
"opt-in-date": "2014-08-21 17:34:47",
"opt-out": "false"
}
6 changes: 6 additions & 0 deletions Vonage.Test.Unit/Data/ShortCodeTests/ManageOptInAsync.json
@@ -0,0 +1,6 @@
{
"msisdn": "15559301529",
"opt-in": "true",
"opt-in-date": "2014-08-21 17:34:47",
"opt-out": "false"
}
24 changes: 24 additions & 0 deletions Vonage.Test.Unit/Data/ShortCodeTests/QueryOptIns.json
@@ -0,0 +1,24 @@
{
"opt-in-count": "3",
"opt-in-list": [
{
"msisdn": "15558937009",
"opt-in": "false",
"opt-out": "true",
"opt-out-date": "2014-06-27 18:31:33"
},
{
"msisdn": "15554908975",
"opt-in": "false",
"opt-out": "true",
"opt-out-date": "2014-07-18 16:20:20"
},
{
"msisdn": "15559912501",
"opt-in": "false",
"opt-in-date": "2014-07-18 15:28:23",
"opt-out": "true",
"opt-out-date": "2014-08-18 23:17:40"
}
]
}
24 changes: 24 additions & 0 deletions Vonage.Test.Unit/Data/ShortCodeTests/QueryOptInsAsync.json
@@ -0,0 +1,24 @@
{
"opt-in-count": "3",
"opt-in-list": [
{
"msisdn": "15558937009",
"opt-in": "false",
"opt-out": "true",
"opt-out-date": "2014-06-27 18:31:33"
},
{
"msisdn": "15554908975",
"opt-in": "false",
"opt-out": "true",
"opt-out-date": "2014-07-18 16:20:20"
},
{
"msisdn": "15559912501",
"opt-in": "false",
"opt-in-date": "2014-07-18 15:28:23",
"opt-out": "true",
"opt-out-date": "2014-08-18 23:17:40"
}
]
}
16 changes: 16 additions & 0 deletions Vonage.Test.Unit/Data/ShortCodeTests/SendAlert.json
@@ -0,0 +1,16 @@
{
"message-count": "1",
"messages": [
{
"status": "delivered",
"message-id": "abcdefg",
"to": "16365553226",
"client-ref": "client-ref",
"remaining-balance": "remaining-balance",
"message-price": "message-price",
"network": "network",
"error-code": "0",
"error-text": "error-message"
}
]
}
16 changes: 16 additions & 0 deletions Vonage.Test.Unit/Data/ShortCodeTests/SendAlertAsync.json
@@ -0,0 +1,16 @@
{
"message-count": "1",
"messages": [
{
"status": "delivered",
"message-id": "abcdefg",
"to": "16365553226",
"client-ref": "client-ref",
"remaining-balance": "remaining-balance",
"message-price": "message-price",
"network": "network",
"error-code": "0",
"error-text": "error-message"
}
]
}
15 changes: 15 additions & 0 deletions Vonage.Test.Unit/Data/ShortCodeTests/SendTwoFactorAuth.json
@@ -0,0 +1,15 @@
{
"message-count": "1",
"messages": [
{
"status": "returnCode",
"message-id": "messageId",
"to": "to",
"client-ref": "client-ref",
"remaining-balance": "remaining-balance",
"message-price": "message-price",
"network": "network",
"error-text": "error-message"
}
]
}
15 changes: 15 additions & 0 deletions Vonage.Test.Unit/Data/ShortCodeTests/SendTwoFactorAuthAsync.json
@@ -0,0 +1,15 @@
{
"message-count": "1",
"messages": [
{
"status": "returnCode",
"message-id": "messageId",
"to": "to",
"client-ref": "client-ref",
"remaining-balance": "remaining-balance",
"message-price": "message-price",
"network": "network",
"error-text": "error-message"
}
]
}
5 changes: 1 addition & 4 deletions Vonage.Test.Unit/JwtTest.cs
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using Xunit;

namespace Vonage.Test.Unit
{
Expand Down

0 comments on commit cd3c53a

Please sign in to comment.