Skip to content

Add SourceLink support to package #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ on:
pull_request:
branches: [ main ]
env:
JsonDiffPatchSolutionPath: src/SystemTextJson.JsonDiffPatch.sln
JsonDiffPatchSolutionPath: ./SystemTextJson.JsonDiffPatch.sln
jobs:
build:
strategy:
139 changes: 135 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
## Get latest from `dotnet new gitignore`

# dotenv files
.env

# User-specific files
*.rsuser
@@ -23,6 +26,7 @@ mono_crash.*
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
@@ -56,11 +60,17 @@ dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET Core
# .NET
project.lock.json
project.fragment.lock.json
artifacts/

# Tye
.tye/

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

# StyleCop
StyleCopReport.xml

@@ -86,6 +96,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
@@ -137,6 +148,11 @@ _TeamCity*
.axoCover/*
!.axoCover/settings.json

# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info

# Visual Studio code coverage results
*.coverage
*.coveragexml
@@ -284,6 +300,17 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
@@ -340,6 +367,9 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# BeatPulse healthcheck temp database
healthchecksdb

@@ -349,5 +379,106 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Rider
.idea/
# Fody - auto-generated XML schema
FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml
.idea

##
## Visual studio for Mac
##


# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/

# Mac bundle stuff
*.dmg
*.app

# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# Vim temporary swap files
*.swp
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"davidanson.vscode-markdownlint",
"dotjoshjohnson.xml",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"github.vscode-pull-request-github",
"jebbs.markdown-extended",
"jrieken.md-navigate",
"ms-dotnettools.csdevkit",
"yzhang.markdown-all-in-one"
]
}
136 changes: 136 additions & 0 deletions SystemTextJson.JsonDiffPatch.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why moved solution file here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it makes more sense to have the sln file at the root, since the src folder will contain the source for the library itself, and the test folder will contain the source code for the tests.

IMO, it's easier to find the sln file in the root, since many open source .NET repos follow this paradigm, and it makes more sense to reference like src\SystemTextJson.JsonDiffPatch\SystemTextJson.JsonDiffPatch.csproj & test\SystemTextJson.JsonDiffPatch.UnitTests\SystemTextJson.JsonDiffPatch.UnitTests.csproj rather than SystemTextJson.JsonDiffPatch\SystemTextJson.JsonDiffPatch.csproj & ..\test\SystemTextJson.JsonDiffPatch.UnitTests\SystemTextJson.JsonDiffPatch.UnitTests.csproj.

# Visual Studio Version 17
VisualStudioVersion = 17.8.34309.116
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3707B7E8-C345-4F67-9C37-56FF2A62B720}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
Benchmark.md = Benchmark.md
global.json = global.json
icon.png = icon.png
LICENSE = LICENSE
README.md = README.md
ReleaseNotes.md = ReleaseNotes.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{E9160ECA-64C8-44AC-8172-3CE535FCF02C}"
ProjectSection(SolutionItems) = preProject
.config\dotnet-tools.json = .config\dotnet-tools.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{2E4C38DE-0426-40A2-AB0B-507BF6F5B0A6}"
ProjectSection(SolutionItems) = preProject
.github\CODEOWNERS = .github\CODEOWNERS
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3B8ADCDE-F7B8-41BD-8415-B0C1DEF1BB93}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build-and-test.yaml = .github\workflows\build-and-test.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{29B23CE8-F9BF-49CD-873D-4786A081A29B}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch", "src\SystemTextJson.JsonDiffPatch\SystemTextJson.JsonDiffPatch.csproj", "{2F8D59B0-53DE-4EE7-A704-D3F89A00D9DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch.Xunit", "src\SystemTextJson.JsonDiffPatch.Xunit\SystemTextJson.JsonDiffPatch.Xunit.csproj", "{8CC0FE2E-297C-4427-8B66-B50E867823C3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch.MSTest", "src\SystemTextJson.JsonDiffPatch.MSTest\SystemTextJson.JsonDiffPatch.MSTest.csproj", "{B2E4B8B6-9F55-4C99-8968-43144BEB809B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch.NUnit", "src\SystemTextJson.JsonDiffPatch.NUnit\SystemTextJson.JsonDiffPatch.NUnit.csproj", "{194DF788-2210-444E-826B-C3A6C10F14F7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{AE524BA2-D5E2-4D5F-BC95-9AA064D46234}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{2066569A-C60A-42F6-B10A-C2F0D80143A3}"
ProjectSection(SolutionItems) = preProject
test\Examples\demo_diff.json = test\Examples\demo_diff.json
test\Examples\demo_diff_jsonpatch.json = test\Examples\demo_diff_jsonpatch.json
test\Examples\demo_diff_notext.json = test\Examples\demo_diff_notext.json
test\Examples\demo_left.json = test\Examples\demo_left.json
test\Examples\demo_right.json = test\Examples\demo_right.json
test\Examples\large_diff.json = test\Examples\large_diff.json
test\Examples\large_diff_jsonpatch.json = test\Examples\large_diff_jsonpatch.json
test\Examples\large_diff_notext.json = test\Examples\large_diff_notext.json
test\Examples\large_left.json = test\Examples\large_left.json
test\Examples\large_right.json = test\Examples\large_right.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch.UnitTests", "test\SystemTextJson.JsonDiffPatch.UnitTests\SystemTextJson.JsonDiffPatch.UnitTests.csproj", "{832E60B1-0225-48B3-9AAD-638A0F5AA15E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch.Benchmark", "test\SystemTextJson.JsonDiffPatch.Benchmark\SystemTextJson.JsonDiffPatch.Benchmark.csproj", "{0F173CC9-EA04-4243-A506-E2C59C905A5E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch.Xunit.Tests", "test\SystemTextJson.JsonDiffPatch.Xunit.Tests\SystemTextJson.JsonDiffPatch.Xunit.Tests.csproj", "{5AEAC978-7DD8-43BA-880E-D5B8B27EF7E7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch.MSTest.Tests", "test\SystemTextJson.JsonDiffPatch.MSTest.Tests\SystemTextJson.JsonDiffPatch.MSTest.Tests.csproj", "{B3AF3E1B-7FAE-4105-97DD-B7635CD2A6CD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson.JsonDiffPatch.NUnit.Tests", "test\SystemTextJson.JsonDiffPatch.NUnit.Tests\SystemTextJson.JsonDiffPatch.NUnit.Tests.csproj", "{7FAB51DE-6ED6-4CCA-887C-DB8274237E92}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2F8D59B0-53DE-4EE7-A704-D3F89A00D9DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F8D59B0-53DE-4EE7-A704-D3F89A00D9DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F8D59B0-53DE-4EE7-A704-D3F89A00D9DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F8D59B0-53DE-4EE7-A704-D3F89A00D9DC}.Release|Any CPU.Build.0 = Release|Any CPU
{8CC0FE2E-297C-4427-8B66-B50E867823C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CC0FE2E-297C-4427-8B66-B50E867823C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CC0FE2E-297C-4427-8B66-B50E867823C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CC0FE2E-297C-4427-8B66-B50E867823C3}.Release|Any CPU.Build.0 = Release|Any CPU
{B2E4B8B6-9F55-4C99-8968-43144BEB809B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2E4B8B6-9F55-4C99-8968-43144BEB809B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2E4B8B6-9F55-4C99-8968-43144BEB809B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2E4B8B6-9F55-4C99-8968-43144BEB809B}.Release|Any CPU.Build.0 = Release|Any CPU
{194DF788-2210-444E-826B-C3A6C10F14F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{194DF788-2210-444E-826B-C3A6C10F14F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{194DF788-2210-444E-826B-C3A6C10F14F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{194DF788-2210-444E-826B-C3A6C10F14F7}.Release|Any CPU.Build.0 = Release|Any CPU
{832E60B1-0225-48B3-9AAD-638A0F5AA15E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{832E60B1-0225-48B3-9AAD-638A0F5AA15E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{832E60B1-0225-48B3-9AAD-638A0F5AA15E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{832E60B1-0225-48B3-9AAD-638A0F5AA15E}.Release|Any CPU.Build.0 = Release|Any CPU
{0F173CC9-EA04-4243-A506-E2C59C905A5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F173CC9-EA04-4243-A506-E2C59C905A5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F173CC9-EA04-4243-A506-E2C59C905A5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F173CC9-EA04-4243-A506-E2C59C905A5E}.Release|Any CPU.Build.0 = Release|Any CPU
{5AEAC978-7DD8-43BA-880E-D5B8B27EF7E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5AEAC978-7DD8-43BA-880E-D5B8B27EF7E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5AEAC978-7DD8-43BA-880E-D5B8B27EF7E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5AEAC978-7DD8-43BA-880E-D5B8B27EF7E7}.Release|Any CPU.Build.0 = Release|Any CPU
{B3AF3E1B-7FAE-4105-97DD-B7635CD2A6CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B3AF3E1B-7FAE-4105-97DD-B7635CD2A6CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3AF3E1B-7FAE-4105-97DD-B7635CD2A6CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3AF3E1B-7FAE-4105-97DD-B7635CD2A6CD}.Release|Any CPU.Build.0 = Release|Any CPU
{7FAB51DE-6ED6-4CCA-887C-DB8274237E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FAB51DE-6ED6-4CCA-887C-DB8274237E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FAB51DE-6ED6-4CCA-887C-DB8274237E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FAB51DE-6ED6-4CCA-887C-DB8274237E92}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3B8ADCDE-F7B8-41BD-8415-B0C1DEF1BB93} = {2E4C38DE-0426-40A2-AB0B-507BF6F5B0A6}
{2F8D59B0-53DE-4EE7-A704-D3F89A00D9DC} = {29B23CE8-F9BF-49CD-873D-4786A081A29B}
{8CC0FE2E-297C-4427-8B66-B50E867823C3} = {29B23CE8-F9BF-49CD-873D-4786A081A29B}
{B2E4B8B6-9F55-4C99-8968-43144BEB809B} = {29B23CE8-F9BF-49CD-873D-4786A081A29B}
{194DF788-2210-444E-826B-C3A6C10F14F7} = {29B23CE8-F9BF-49CD-873D-4786A081A29B}
{2066569A-C60A-42F6-B10A-C2F0D80143A3} = {AE524BA2-D5E2-4D5F-BC95-9AA064D46234}
{832E60B1-0225-48B3-9AAD-638A0F5AA15E} = {AE524BA2-D5E2-4D5F-BC95-9AA064D46234}
{0F173CC9-EA04-4243-A506-E2C59C905A5E} = {AE524BA2-D5E2-4D5F-BC95-9AA064D46234}
{5AEAC978-7DD8-43BA-880E-D5B8B27EF7E7} = {AE524BA2-D5E2-4D5F-BC95-9AA064D46234}
{B3AF3E1B-7FAE-4105-97DD-B7635CD2A6CD} = {AE524BA2-D5E2-4D5F-BC95-9AA064D46234}
{7FAB51DE-6ED6-4CCA-887C-DB8274237E92} = {AE524BA2-D5E2-4D5F-BC95-9AA064D46234}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F15DC234-2EF5-47F9-BB66-3C651311A3E5}
EndGlobalSection
EndGlobal
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "minor",
"allowPrerelease": true
}
}
18 changes: 13 additions & 5 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
<Project>
<Project>

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.0;net462</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<DebugType>Embedded</DebugType>
<EmbedAllSources>True</EmbedAllSources>
</PropertyGroup>

<PropertyGroup>
<IsPackable>true</IsPackable>
<JsonDiffPatchPackageVersion>2.0.0</JsonDiffPatchPackageVersion>
<Authors>Wei Chen</Authors>
<PackageProjectUrl>https://github.com/weichch/system-text-json-jsondiffpatch</PackageProjectUrl>
<Copyright>Copyright © Wei Chen 2024</Copyright>
<RepositoryUrl>https://github.com/weichch/system-text-json-jsondiffpatch.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright © Wei Chen 2022</Copyright>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReleaseNotes>https://github.com/weichch/system-text-json-jsondiffpatch/blob/$(JsonDiffPatchPackageVersion)/ReleaseNotes.md</PackageReleaseNotes>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup>
<Version>$(JsonDiffPatchPackageVersion)</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<AssemblyVersion>$(JsonDiffPatchPackageVersion).0</AssemblyVersion>
<FileVersion>$(JsonDiffPatchPackageVersion).0</FileVersion>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\icon.png" Link="Packaging\icon.png" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE" Link="Packaging\LICENSE" Pack="true" PackagePath="\" />
<None Include="..\..\THIRD-PARTY-NOTICES.txt" Link="Packaging\THIRD-PARTY-NOTICES.txt" Pack="true" PackagePath="\" />
<None Include="..\..\THIRD-PARTY-NOTICES.txt" Link="Packaging\THIRD-PARTY-NOTICES.txt" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -15,7 +15,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -15,7 +15,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NUnit" Version="3.14.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -15,7 +15,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit.assert" Version="2.4.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit.assert" Version="2.6.6" />
</ItemGroup>

</Project>
82 changes: 0 additions & 82 deletions src/SystemTextJson.JsonDiffPatch.sln

This file was deleted.

Original file line number Diff line number Diff line change
@@ -15,12 +15,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<Compile Remove="JsonBytes.cs" />
<None Include="JsonBytes.cs" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<ServerGarbageCollection>true</ServerGarbageCollection>
<IsTestProject>false</IsTestProject>
</PropertyGroup>

<ItemGroup>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
34 changes: 20 additions & 14 deletions test/SystemTextJson.JsonDiffPatch.NUnit.Tests/JsonAssertTests.cs
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ public class JsonAssertTests
[Test]
public void AreEqual_String()
{
var json1 = "{\"foo\":\"bar\",\"baz\":\"qux\"}";
var json2 = "{\"baz\":\"qux\",\"foo\":\"bar\"}";
const string json1 = "{\"foo\":\"bar\",\"baz\":\"qux\"}";
const string json2 = "{\"baz\":\"qux\",\"foo\":\"bar\"}";

JsonAssert.AreEqual(json1, json2);
}
@@ -43,7 +43,7 @@ public void AreEqual_FailWithMessage()
var error = Assert.Throws<AssertionException>(
() => JsonAssert.AreEqual(json1, json2));

StringAssert.Contains("JsonAssert.AreEqual() failure.", error!.Message);
Assert.That(error!.Message, Does.Contain("JsonAssert.AreEqual() failure."));
}

[Test]
@@ -55,10 +55,13 @@ public void AreEqual_FailWithDefaultOutput()
var error = Assert.Throws<AssertionException>(
() => JsonAssert.AreEqual(json1, json2, true));

StringAssert.Contains("JsonAssert.AreEqual() failure.", error!.Message);
StringAssert.Contains("Expected:", error.Message);
StringAssert.Contains("Actual:", error.Message);
StringAssert.Contains("Delta:", error.Message);
Assert.Multiple(() =>
{
Assert.That(error!.Message, Does.Contain("JsonAssert.AreEqual() failure."));
Assert.That(error.Message, Does.Contain("Expected:"));
Assert.That(error.Message, Does.Contain("Actual:"));
Assert.That(error.Message, Does.Contain("Delta:"));
});
}

[Test]
@@ -70,15 +73,18 @@ public void AreEqual_FailWithCustomOutput()
var error = Assert.Throws<AssertionException>(() => JsonAssert.AreEqual(json1,
json2, _ => "Custom message"));

StringAssert.Contains("JsonAssert.AreEqual() failure.", error!.Message);
StringAssert.Contains("Custom message", error.Message);
Assert.Multiple(() =>
{
Assert.That(error!.Message, Does.Contain("JsonAssert.AreEqual() failure."));
Assert.That(error.Message, Does.Contain("Custom message"));
});
}

[Test]
public void AreNotEqual_String()
{
var json1 = "{\"foo\":\"bar\",\"baz\":\"qux\"}";
var json2 = "{\"foo\":\"baz\"}";
const string json1 = "{\"foo\":\"bar\",\"baz\":\"qux\"}";
const string json2 = "{\"foo\":\"baz\"}";

JsonAssert.AreNotEqual(json1, json2);
}
@@ -100,8 +106,8 @@ public void AreNotEqual_Nulls()

var error = Assert.Throws<AssertionException>(
() => JsonAssert.AreNotEqual(json1, json2));
Assert.IsNotNull(error);

Assert.That(error, Is.Not.Null);
}

[Test]
@@ -113,7 +119,7 @@ public void AreNotEqual_FailWithMessage()
var error = Assert.Throws<AssertionException>(
() => JsonAssert.AreNotEqual(json1, json2));

StringAssert.Contains("JsonAssert.AreNotEqual() failure.", error!.Message);
Assert.That(error!.Message, Does.Contain("JsonAssert.AreNotEqual() failure."));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.14.0"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>