Testing.Dynamic.Json
1.0.0-rc3
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
This is a prerelease version of Testing.Dynamic.Json.
dotnet add package Testing.Dynamic.Json --version 1.0.0-rc3
NuGet\Install-Package Testing.Dynamic.Json -Version 1.0.0-rc3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Testing.Dynamic.Json" Version="1.0.0-rc3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Testing.Dynamic.Json --version 1.0.0-rc3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Testing.Dynamic.Json, 1.0.0-rc3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Testing.Dynamic.Json as a Cake Addin #addin nuget:?package=Testing.Dynamic.Json&version=1.0.0-rc3&prerelease // Install Testing.Dynamic.Json as a Cake Tool #tool nuget:?package=Testing.Dynamic.Json&version=1.0.0-rc3&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Testing.Dynamic.Json
Provides dynamicly access to property/member of Json object deserialized by System.Text.Json. This library is used for unit testing purpose only. It is not designated for production usage.
Nuget package
Build Status
Getting started
To support testing with dynamic json, first install the NuGet package:
Install-Package Testing.Dynamic.Json
Example dynamic json
- Newtonsoft Json support
const string json = "[ 123, \"abc\", { \"iss\": \"Sso Issuer\", \"iat\": 1607746395 }]";
var jToken = Newtonsoft.Json.Linq.JToken.Parse(json);
Assert.Equal(3, (jToken as JArray).Count);
Assert.Equal(123, jToken[0]);
Assert.Equal(123L, jToken[0]);
Assert.Equal("abc", jToken[1]);
var jwtPayload = jToken[2];
Assert.Equal("Sso Issuer", jwtPayload["iss"]);
Assert.Equal(1607746395, jwtPayload["iat"]);
- Testing.Dynamic.Json support
var djson = System.Text.Json.JsonSerializer.Deserialize<DJson>(json);
Assert.Equal(3, djson.CountMembers);
Assert.Equal(123, (int)(long)djson[0]);
Assert.Equal(123L, djson[0]);
Assert.Equal("abc", djson[1]);
var jwtPayload = (DJson)djson[2];
Assert.Equal("Sso Issuer", jwtPayload["iss"]);
Assert.Equal(1607746395L, jwtPayload["iat"]);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- System.Text.Json (>= 5.0.0)
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.0.0-rc3 | 303 | 9/16/2022 | |
1.0.0-rc2 | 35,860 | 10/18/2021 | |
1.0.0-rc1 | 70,536 | 9/17/2021 | |
1.0.0-preview2 | 73,110 | 12/12/2020 | |
1.0.0-beta.2 | 253 | 12/17/2020 | |
1.0.0-beta.1 | 239 | 12/13/2020 |