GPreviatti.Util.JsonResourceAttribute
8.0.7
See the version list below for details.
dotnet add package GPreviatti.Util.JsonResourceAttribute --version 8.0.7
NuGet\Install-Package GPreviatti.Util.JsonResourceAttribute -Version 8.0.7
<PackageReference Include="GPreviatti.Util.JsonResourceAttribute" Version="8.0.7" />
paket add GPreviatti.Util.JsonResourceAttribute --version 8.0.7
#r "nuget: GPreviatti.Util.JsonResourceAttribute, 8.0.7"
// Install GPreviatti.Util.JsonResourceAttribute as a Cake Addin #addin nuget:?package=GPreviatti.Util.JsonResourceAttribute&version=8.0.7 // Install GPreviatti.Util.JsonResourceAttribute as a Cake Tool #tool nuget:?package=GPreviatti.Util.JsonResourceAttribute&version=8.0.7
Json Resource Attribute Package
This simple package that exposes an attribute to helps testing with json files.
Configuration
Install package in the project and add this block in your test csproj file in order to copy your json files into the debug folder
<ItemGroup>
<None Remove="**\*.json" />
<EmbeddedResource Include="**\*.json" Exclude="bin\**;obj\**" />
</ItemGroup>
How to use
After install the package you have to decorate your test method with attribute and add the json file reference
[Theory(DisplayName = nameof(People_Should_Have_Major_Age))]
[JsonResourceData("json-resource-data-attribute.json", "majorAge")]
public void People_Should_Have_Major_Age(Person[] people, bool expected)
{
// Arrange, Act
var result = people.Any(p => p.IsMajorAge().Equals(expected));
// Assert
Assert.True(result);
}
You should create a json file and add the node with a name that will be identified by the test in the example the name is majorAge
Samples
The samples of how to use the json resource attribute are available in test project of package
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
- xunit.extensibility.core (>= 2.6.6)
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 |
---|---|---|
8.0.19 | 306 | 1/16/2024 |
8.0.18 | 106 | 1/16/2024 |
8.0.17 | 106 | 1/16/2024 |
8.0.16 | 106 | 1/16/2024 |
8.0.15 | 101 | 1/16/2024 |
8.0.14 | 110 | 1/16/2024 |
8.0.13 | 112 | 1/16/2024 |
8.0.12 | 110 | 1/16/2024 |
8.0.11 | 105 | 1/16/2024 |
8.0.10 | 116 | 1/16/2024 |
8.0.9 | 108 | 1/16/2024 |
8.0.8 | 113 | 1/16/2024 |
8.0.7 | 97 | 1/16/2024 |
8.0.6 | 110 | 1/15/2024 |
8.0.4 | 114 | 1/15/2024 |
1.0.0 | 121 | 1/15/2024 |
Improve package namespace and folder