-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Serialize streamUrl as array per docs to avoid bad request
- Loading branch information
Brandon
committed
Mar 20, 2020
1 parent
b3bd241
commit 0d804c9
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Newtonsoft.Json; | ||
using Nexmo.Api.Voice.Nccos; | ||
|
||
namespace Nexmo.Api.Test.Unit | ||
{ | ||
[TestClass] | ||
public class StreamActionTest | ||
{ | ||
[TestMethod] | ||
public void TestStreamUrl() | ||
{ | ||
//Arrange | ||
var expected = "{\"streamUrl\":[\"https://www.example.com/waiting.mp3\"],\"action\":\"stream\"}"; | ||
var action = new StreamAction() { StreamUrl = new string[] { "https://www.example.com/waiting.mp3" } }; | ||
//Act | ||
var serialized = JsonConvert.SerializeObject(action, Formatting.None, | ||
new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore }); | ||
//Assert | ||
Assert.AreEqual(expected, serialized); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters