Skip to content

Commit 8a05309

Browse files
Upgrade NewtonSoft version used by test projects (Azure#40877)
* Upgrade NewtonSoft version used by test projects * Fix nullability
1 parent 95ebe51 commit 8a05309

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
<PackageReference Update="Moq" Version="[4.18.2]" /><!-- This version should not be changed without team discussion. -->
277277
<PackageReference Update="MSTest.TestAdapter" Version="1.3.2" />
278278
<PackageReference Update="MSTest.TestFramework" Version="1.3.2" />
279-
<PackageReference Update="Newtonsoft.Json" Version="10.0.3" />
279+
<PackageReference Update="Newtonsoft.Json" Version="13.0.1" />
280280
<PackageReference Update="NSubstitute" Version="3.1.0" />
281281
<PackageReference Update="NUnit" Version="3.13.2" />
282282
<PackageReference Update="NUnit3TestAdapter" Version="4.4.2" />

sdk/communication/Azure.Communication.CallAutomation/tests/Streaming/StreamingDataParserTests.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public void ParseBinaryAudioData()
6969
JObject jsonData = new JObject();
7070
jsonData["kind"] = "AudioData";
7171
jsonData["audioData"] = new JObject();
72-
jsonData["audioData"]["data"] = "AQIDBAU=";
73-
jsonData["audioData"]["timestamp"] = "2022-08-23T11:48:05Z";
74-
jsonData["audioData"]["participantRawID"] = "participantId";
75-
jsonData["audioData"]["silent"] = false;
72+
jsonData["audioData"]!["data"] = "AQIDBAU=";
73+
jsonData["audioData"]!["timestamp"] = "2022-08-23T11:48:05Z";
74+
jsonData["audioData"]!["participantRawID"] = "participantId";
75+
jsonData["audioData"]!["silent"] = false;
7676

7777
var binaryData = BinaryData.FromString(jsonData.ToString());
7878

@@ -86,10 +86,10 @@ public void ParseAudioDataEventsWithBinaryArray()
8686
JObject jsonData = new JObject();
8787
jsonData["kind"] = "AudioData";
8888
jsonData["audioData"] = new JObject();
89-
jsonData["audioData"]["data"] = "AQIDBAU=";
90-
jsonData["audioData"]["timestamp"] = "2022-08-23T11:48:05Z";
91-
jsonData["audioData"]["participantRawID"] = "participantId";
92-
jsonData["audioData"]["silent"] = false;
89+
jsonData["audioData"]!["data"] = "AQIDBAU=";
90+
jsonData["audioData"]!["timestamp"] = "2022-08-23T11:48:05Z";
91+
jsonData["audioData"]!["participantRawID"] = "participantId";
92+
jsonData["audioData"]!["silent"] = false;
9393

9494
byte[] receivedBytes = System.Text.Encoding.UTF8.GetBytes(jsonData.ToString());
9595
AudioData parsedPackage = (AudioData)StreamingDataParser.Parse(receivedBytes);
@@ -188,13 +188,13 @@ public void ParseTranscriptionBinaryData()
188188
["kind"] = "TranscriptionData",
189189
["transcriptionData"] = new JObject()
190190
};
191-
jsonData["transcriptionData"]["text"] = "Hello World!";
192-
jsonData["transcriptionData"]["format"] = "display";
193-
jsonData["transcriptionData"]["confidence"] = 0.98d;
194-
jsonData["transcriptionData"]["offset"] = 1;
191+
jsonData["transcriptionData"]!["text"] = "Hello World!";
192+
jsonData["transcriptionData"]!["format"] = "display";
193+
jsonData["transcriptionData"]!["confidence"] = 0.98d;
194+
jsonData["transcriptionData"]!["offset"] = 1;
195195

196196
JArray words = new();
197-
jsonData["transcriptionData"]["words"] = words;
197+
jsonData["transcriptionData"]!["words"] = words;
198198

199199
JObject word0 = new()
200200
{
@@ -210,8 +210,8 @@ public void ParseTranscriptionBinaryData()
210210
};
211211
words.Add(word1);
212212

213-
jsonData["transcriptionData"]["participantRawID"] = "abc12345";
214-
jsonData["transcriptionData"]["resultStatus"] = "final";
213+
jsonData["transcriptionData"]!["participantRawID"] = "abc12345";
214+
jsonData["transcriptionData"]!["resultStatus"] = "final";
215215

216216
var binaryData = BinaryData.FromString(jsonData.ToString());
217217

@@ -227,13 +227,13 @@ public void ParseTranscriptionDataEventsWithBinaryArray()
227227
["kind"] = "TranscriptionData",
228228
["transcriptionData"] = new JObject()
229229
};
230-
jsonData["transcriptionData"]["text"] = "Hello World!";
231-
jsonData["transcriptionData"]["format"] = "display";
232-
jsonData["transcriptionData"]["confidence"] = 0.98d;
233-
jsonData["transcriptionData"]["offset"] = 1;
230+
jsonData["transcriptionData"]!["text"] = "Hello World!";
231+
jsonData["transcriptionData"]!["format"] = "display";
232+
jsonData["transcriptionData"]!["confidence"] = 0.98d;
233+
jsonData["transcriptionData"]!["offset"] = 1;
234234

235235
JArray words = new();
236-
jsonData["transcriptionData"]["words"] = words;
236+
jsonData["transcriptionData"]!["words"] = words;
237237

238238
JObject word0 = new()
239239
{
@@ -249,8 +249,8 @@ public void ParseTranscriptionDataEventsWithBinaryArray()
249249
};
250250
words.Add(word1);
251251

252-
jsonData["transcriptionData"]["participantRawID"] = "abc12345";
253-
jsonData["transcriptionData"]["resultStatus"] = "final";
252+
jsonData["transcriptionData"]!["participantRawID"] = "abc12345";
253+
jsonData["transcriptionData"]!["resultStatus"] = "final";
254254

255255
byte[] receivedBytes = System.Text.Encoding.UTF8.GetBytes(jsonData.ToString());
256256
TranscriptionData parsedPackage = (TranscriptionData)StreamingDataParser.Parse(receivedBytes);

0 commit comments

Comments
 (0)