Skip to content

Commit

Permalink
Patch tests post Newtonsoft.Json upgrade to 13.0.1 (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid authored Mar 28, 2023
1 parent 2ed42be commit ce209b5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ await this.worker
if (mode == ErrorPropagationMode.SerializeExceptions)
{
// The exception should be deserializable
InvalidOperationException e = JsonConvert.DeserializeObject<InvalidOperationException>(state.Output);
InvalidOperationException? e = JsonConvert.DeserializeObject<InvalidOperationException>(state.Output);
Assert.IsNotNull(e);
Assert.AreEqual("This is a test exception", e.Message);
Assert.AreEqual("This is a test exception", e!.Message);
}
else if (mode == ErrorPropagationMode.UseFailureDetails)
{
// The failure details should contain the relevant exception metadata
FailureDetails details = JsonConvert.DeserializeObject<FailureDetails>(state.Output);
FailureDetails? details = JsonConvert.DeserializeObject<FailureDetails>(state.Output);
Assert.IsNotNull(details);
Assert.AreEqual(typeof(InvalidOperationException).FullName, details.ErrorType);
Assert.AreEqual(typeof(InvalidOperationException).FullName, details!.ErrorType);
Assert.IsTrue(details.IsCausedBy<InvalidOperationException>());
Assert.IsTrue(details.IsCausedBy<Exception>()); // check that base types work too
Assert.AreEqual("This is a test exception", details.ErrorMessage);
Expand Down
2 changes: 1 addition & 1 deletion src/DurableTask.Emulator/DurableTask.Emulator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Newtonsoft.Json" version="11.0.2" />
<PackageReference Include="Newtonsoft.Json" version="13.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.6" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="WindowsAzure.Storage" version="9.3.3" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Newtonsoft.Json" version="11.0.2" />
<PackageReference Include="Newtonsoft.Json" version="13.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
Expand Down

0 comments on commit ce209b5

Please sign in to comment.