├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md ├── dependabot.yml ├── workflows │ ├── merge-dependabot.yml │ └── on-push-do-docs.yml └── stale.yml ├── docs ├── zzz.png ├── intro.include.md └── zzz.include.md ├── src ├── icon.png ├── key.snk ├── Tests │ ├── GlobalUsings.cs │ ├── Samples.PagesToInclude.verified.png │ ├── Samples.VerifyDocument#00.verified.png │ ├── Samples.VerifyDocument#01.verified.png │ ├── Samples.PagesToIncludeDynamic.verified.png │ ├── Samples.PagesToInclude.verified.txt │ ├── Samples.VerifyDocument.verified.txt │ ├── Samples.PagesToIncludeDynamic.verified.txt │ ├── ModuleInitializer.cs │ ├── Tests.csproj │ └── Samples.cs ├── Verify.QuestPDF │ ├── ShouldIncludePage.cs │ ├── GlobalUsings.cs │ ├── Verify.QuestPDF.csproj │ ├── DocumentSettingsConverter.cs │ ├── DocumentMetadataConverter.cs │ ├── QuestPDFSettings.cs │ └── VerifyQuestPdf.cs ├── global.json ├── mdsnippets.json ├── Verify.QuestPDF.slnx ├── appveyor.yml ├── Directory.Build.props ├── Verify.QuestPDF.slnx.DotSettings ├── nuget.md ├── Directory.Packages.props ├── nuget.config ├── .editorconfig └── Shared.sln.DotSettings ├── .gitignore ├── code_of_conduct.md ├── .gitattributes ├── license.txt └── readme.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: VerifyTests 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false -------------------------------------------------------------------------------- /docs/zzz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/HEAD/docs/zzz.png -------------------------------------------------------------------------------- /src/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/HEAD/src/icon.png -------------------------------------------------------------------------------- /src/key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/HEAD/src/key.snk -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.user 3 | bin/ 4 | obj/ 5 | .vs/ 6 | *.DotSettings.user 7 | .idea/ 8 | *.received.* 9 | nugets/ -------------------------------------------------------------------------------- /src/Tests/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using QuestPDF.Fluent; 2 | global using QuestPDF.Helpers; 3 | global using QuestPDF.Infrastructure; -------------------------------------------------------------------------------- /src/Verify.QuestPDF/ShouldIncludePage.cs: -------------------------------------------------------------------------------- 1 | namespace VerifyQuestPDF; 2 | 3 | public delegate bool ShouldIncludePage(int pageNumber); -------------------------------------------------------------------------------- /src/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "10.0.101", 4 | "allowPrerelease": true, 5 | "rollForward": "latestFeature" 6 | } 7 | } -------------------------------------------------------------------------------- /src/Tests/Samples.PagesToInclude.verified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/HEAD/src/Tests/Samples.PagesToInclude.verified.png -------------------------------------------------------------------------------- /docs/intro.include.md: -------------------------------------------------------------------------------- 1 | Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of documents via [QuestPDF](https://www.questpdf.com/). -------------------------------------------------------------------------------- /src/Tests/Samples.VerifyDocument#00.verified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/HEAD/src/Tests/Samples.VerifyDocument#00.verified.png -------------------------------------------------------------------------------- /src/Tests/Samples.VerifyDocument#01.verified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/HEAD/src/Tests/Samples.VerifyDocument#01.verified.png -------------------------------------------------------------------------------- /src/Tests/Samples.PagesToIncludeDynamic.verified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/HEAD/src/Tests/Samples.PagesToIncludeDynamic.verified.png -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: nuget 4 | directory: "/src" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | -------------------------------------------------------------------------------- /src/Verify.QuestPDF/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using System.Diagnostics.CodeAnalysis; 2 | global using QuestPDF.Fluent; 3 | global using QuestPDF.Infrastructure; 4 | global using VerifyQuestPDF; -------------------------------------------------------------------------------- /src/mdsnippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/schema.json", 3 | "TocExcludes": [ "NuGet package", "Release Notes", "Icon" ], 4 | "MaxWidth": 80, 5 | "ValidateContent": true, 6 | "Convention": "InPlaceOverwrite" 7 | } -------------------------------------------------------------------------------- /code_of_conduct.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project has adopted the code of conduct defined by the Contributor Covenant 4 | to clarify expected behavior in our community. 5 | For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/about/code-of-conduct). 6 | -------------------------------------------------------------------------------- /src/Tests/Samples.PagesToInclude.verified.txt: -------------------------------------------------------------------------------- 1 | { 2 | Pages: 2, 3 | Metadata: { 4 | CreationDate: DateTimeOffset_1, 5 | ModifiedDate: DateTimeOffset_2 6 | }, 7 | Settings: { 8 | ContentDirection: LeftToRight, 9 | PDFA_Conformance: None, 10 | PDFUA_Conformance: None, 11 | ImageCompressionQuality: High, 12 | ImageRasterDpi: 288 13 | } 14 | } -------------------------------------------------------------------------------- /src/Tests/Samples.VerifyDocument.verified.txt: -------------------------------------------------------------------------------- 1 | { 2 | Pages: 2, 3 | Metadata: { 4 | CreationDate: DateTimeOffset_1, 5 | ModifiedDate: DateTimeOffset_2 6 | }, 7 | Settings: { 8 | ContentDirection: LeftToRight, 9 | PDFA_Conformance: None, 10 | PDFUA_Conformance: None, 11 | ImageCompressionQuality: High, 12 | ImageRasterDpi: 288 13 | } 14 | } -------------------------------------------------------------------------------- /src/Tests/Samples.PagesToIncludeDynamic.verified.txt: -------------------------------------------------------------------------------- 1 | { 2 | Pages: 2, 3 | Metadata: { 4 | CreationDate: DateTimeOffset_1, 5 | ModifiedDate: DateTimeOffset_2 6 | }, 7 | Settings: { 8 | ContentDirection: LeftToRight, 9 | PDFA_Conformance: None, 10 | PDFUA_Conformance: None, 11 | ImageCompressionQuality: High, 12 | ImageRasterDpi: 288 13 | } 14 | } -------------------------------------------------------------------------------- /.github/workflows/merge-dependabot.yml: -------------------------------------------------------------------------------- 1 | name: merge-dependabot 2 | on: 3 | pull_request: 4 | jobs: 5 | automerge: 6 | runs-on: ubuntu-latest 7 | if: github.actor == 'dependabot[bot]' 8 | steps: 9 | - name: Dependabot Auto Merge 10 | uses: ahmadnassri/action-dependabot-auto-merge@v2.6.6 11 | with: 12 | target: minor 13 | github-token: ${{ secrets.dependabot }} 14 | command: squash and merge -------------------------------------------------------------------------------- /docs/zzz.include.md: -------------------------------------------------------------------------------- 1 | ### Entity Framework Extensions 2 | 3 | [Entity Framework Extensions](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.QuestPDF) is a major sponsor and is proud to contribute to the development this project. 4 | 5 | [![Entity Framework Extensions](https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/refs/heads/main/docs/zzz.png)](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.QuestPDF) -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.snk binary 3 | *.jpg binary 4 | *.png binary 5 | *.pdf binary 6 | 7 | *.verified.txt text eol=lf working-tree-encoding=UTF-8 8 | *.verified.xml text eol=lf working-tree-encoding=UTF-8 9 | *.verified.json text eol=lf working-tree-encoding=UTF-8 10 | 11 | .editorconfig text eol=lf working-tree-encoding=UTF-8 12 | *.sln.DotSettings text eol=lf working-tree-encoding=UTF-8 13 | *.slnx.DotSettings text eol=lf working-tree-encoding=UTF-8 -------------------------------------------------------------------------------- /src/Tests/ModuleInitializer.cs: -------------------------------------------------------------------------------- 1 | public static class ModuleInitializer 2 | { 3 | #region enable 4 | 5 | [ModuleInitializer] 6 | public static void Init() 7 | { 8 | VerifyImageMagick.RegisterComparers(0.015); 9 | VerifyQuestPdf.Initialize(); 10 | } 11 | 12 | #endregion 13 | 14 | [ModuleInitializer] 15 | public static void InitOther() 16 | { 17 | QuestPDF.Settings.License = LicenseType.Community; 18 | VerifierSettings.InitializePlugins(); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Verify.QuestPDF/Verify.QuestPDF.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net48;net6.0;net7.0;net8.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Verify.QuestPDF.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Verify.QuestPDF/DocumentSettingsConverter.cs: -------------------------------------------------------------------------------- 1 | class DocumentSettingsConverter : 2 | WriteOnlyJsonConverter 3 | { 4 | public override void Write(VerifyJsonWriter writer, DocumentSettings value) 5 | { 6 | writer.WriteStartObject(); 7 | writer.WriteMember(value, value.ContentDirection, "ContentDirection"); 8 | writer.WriteMember(value, value.PDFA_Conformance, "PDFA_Conformance"); 9 | writer.WriteMember(value, value.PDFUA_Conformance, "PDFUA_Conformance"); 10 | writer.WriteMember(value, value.ImageCompressionQuality, "ImageCompressionQuality"); 11 | writer.WriteMember(value, value.ImageRasterDpi, "ImageRasterDpi"); 12 | writer.WriteEnd(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2022 2 | environment: 3 | DOTNET_NOLOGO: true 4 | DOTNET_CLI_TELEMETRY_OPTOUT: true 5 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true 6 | build_script: 7 | - pwsh: | 8 | Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1" 9 | ./dotnet-install.ps1 -JSonFile src/global.json -Architecture x64 -InstallDir 'C:\Program Files\dotnet' 10 | - dotnet build src --configuration Release 11 | - dotnet test src --configuration Release --no-build --no-restore --filter Category!=Integration 12 | test: off 13 | on_failure: 14 | - ps: Get-ChildItem *.received.* -recurse | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } 15 | artifacts: 16 | - path: nugets\*.nupkg -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 7 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Set to true to ignore issues in a milestone (defaults to false) 6 | exemptMilestones: true 7 | # Comment to post when marking an issue as stale. Set to `false` to disable 8 | markComment: > 9 | This issue has been automatically marked as stale because it has not had 10 | recent activity. It will be closed if no further activity occurs. Thank you 11 | for your contributions. 12 | # Comment to post when closing a stale issue. Set to `false` to disable 13 | closeComment: false 14 | # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': 15 | pulls: 16 | daysUntilStale: 30 -------------------------------------------------------------------------------- /.github/workflows/on-push-do-docs.yml: -------------------------------------------------------------------------------- 1 | name: on-push-do-docs 2 | on: 3 | push: 4 | jobs: 5 | docs: 6 | runs-on: windows-latest 7 | steps: 8 | - uses: actions/checkout@v4 9 | - name: Run MarkdownSnippets 10 | run: | 11 | dotnet tool install --global MarkdownSnippets.Tool 12 | mdsnippets ${GITHUB_WORKSPACE} 13 | shell: bash 14 | - name: Push changes 15 | run: | 16 | git config --local user.email "action@github.com" 17 | git config --local user.name "GitHub Action" 18 | git commit -m "Docs changes" -a || echo "nothing to commit" 19 | remote="https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git" 20 | branch="${GITHUB_REF:11}" 21 | git push "${remote}" ${branch} || echo "nothing to push" 22 | shell: bash -------------------------------------------------------------------------------- /src/Verify.QuestPDF/DocumentMetadataConverter.cs: -------------------------------------------------------------------------------- 1 | class DocumentMetadataConverter : 2 | WriteOnlyJsonConverter 3 | { 4 | public override void Write(VerifyJsonWriter writer, DocumentMetadata value) 5 | { 6 | writer.WriteStartObject(); 7 | writer.WriteMember(value, value.Author, "Author"); 8 | writer.WriteMember(value, value.Creator, "Creator"); 9 | writer.WriteMember(value, value.Keywords, "Keywords"); 10 | writer.WriteMember(value, value.Producer, "Producer"); 11 | writer.WriteMember(value, value.Title, "Title"); 12 | writer.WriteMember(value, value.Subject, "Subject"); 13 | writer.WriteMember(value, value.CreationDate, "CreationDate"); 14 | writer.WriteMember(value, value.ModifiedDate, "ModifiedDate"); 15 | writer.WriteEnd(); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CS1591;CS0649;NU1608;NU1109 5 | 2.4.0 6 | 1.0.0 7 | preview 8 | enable 9 | QuestPDF, Verify 10 | Extends Verify (https://github.com/VerifyTests/Verify) to allow verification via QuestPDF. 11 | false 12 | true 13 | true 14 | true 15 | true 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | PreserveNewest 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Verify.QuestPDF.slnx.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | ..\Shared.sln.DotSettings 3 | True 4 | True 5 | 1 6 | -------------------------------------------------------------------------------- /src/nuget.md: -------------------------------------------------------------------------------- 1 | [Documentation](https://github.com/VerifyTests/Verify.QuestPDF) 2 | 3 | Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of documents via [QuestPDF](https://www.questpdf.com/). 4 | 5 | **See [Milestones](https://github.com/VerifyTests/Verify.QuestPDF/milestones?state=closed) for release notes.** 6 | 7 | 8 | ## Sponsors 9 | 10 | 11 | ### Entity Framework Extensions 12 | 13 | [Entity Framework Extensions](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.QuestPDF) is a major sponsor and is proud to contribute to the development this project. 14 | 15 | [![Entity Framework Extensions](https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/refs/heads/main/docs/zzz.png)](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.QuestPDF) 16 | -------------------------------------------------------------------------------- /src/Directory.Packages.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | true 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 20 | 21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Verify.QuestPDF/QuestPDFSettings.cs: -------------------------------------------------------------------------------- 1 | namespace VerifyTests; 2 | 3 | public static class QuestPDFSettings 4 | { 5 | public static void PagesToInclude(this VerifySettings settings, int count) => 6 | settings.PagesToInclude(_ => _ <= count); 7 | 8 | public static SettingsTask PagesToInclude(this SettingsTask settings, int count) 9 | { 10 | settings.CurrentSettings.PagesToInclude(_ => _ <= count); 11 | return settings; 12 | } 13 | 14 | public static void PagesToInclude(this VerifySettings settings, ShouldIncludePage include) => 15 | settings.Context["QuestPDF.PagesToInclude"] = include; 16 | 17 | public static SettingsTask PagesToInclude(this SettingsTask settings, ShouldIncludePage include) 18 | { 19 | settings.CurrentSettings.PagesToInclude(include); 20 | return settings; 21 | } 22 | 23 | internal static bool GetPagesToInclude(this IReadOnlyDictionary context, [NotNullWhen(true)] out ShouldIncludePage? include) 24 | { 25 | if (context.TryGetValue("QuestPDF.PagesToInclude", out var value)) 26 | { 27 | include = (ShouldIncludePage) value; 28 | return true; 29 | } 30 | 31 | include = null; 32 | return false; 33 | } 34 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: How to raise feature requests 4 | --- 5 | 6 | 7 | Note: New issues raised, where it is clear the submitter has not read the issue template, are likely to be closed with "please read the issue template". Please don't take offense at this. It is simply a time management decision. If someone raises an issue, and can't be bothered to spend the time to read the issue template, then the project maintainers should not be expected to spend the time to read the submitted issue. Often too much time is spent going back and forth in issue comments asking for information that is outlined in the issue template. 8 | 9 | If you are certain the feature will be accepted, it is better to raise a [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/). 10 | 11 | If you are uncertain if the feature will be accepted, outline the proposal below to confirm it is viable, prior to raising a PR that implements the feature. 12 | 13 | Note that even if the feature is a good idea and viable, it may not be accepted since the ongoing effort in maintaining the feature may outweigh the benefit it delivers. 14 | 15 | 16 | #### Is the feature request related to a problem 17 | 18 | A clear and concise description of what the problem is. 19 | 20 | 21 | #### Describe the solution 22 | 23 | A clear and concise proposal of how you intend to implement the feature. 24 | 25 | 26 | #### Describe alternatives considered 27 | 28 | A clear and concise description of any alternative solutions or features you've considered. 29 | 30 | 31 | #### Additional context 32 | 33 | Add any other context about the feature request here. 34 | -------------------------------------------------------------------------------- /src/Tests/Samples.cs: -------------------------------------------------------------------------------- 1 | [TestFixture] 2 | public class Samples 3 | { 4 | #region VerifyDocument 5 | 6 | [Test] 7 | public Task VerifyDocument() 8 | { 9 | var document = GenerateDocument(); 10 | return Verify(document); 11 | } 12 | 13 | #endregion 14 | 15 | #region PagesToInclude 16 | 17 | [Test] 18 | public Task PagesToInclude() 19 | { 20 | var document = GenerateDocument(); 21 | return Verify(document) 22 | .PagesToInclude(1); 23 | } 24 | 25 | #endregion 26 | 27 | #region PagesToIncludeDynamic 28 | 29 | [Test] 30 | public Task PagesToIncludeDynamic() 31 | { 32 | var document = GenerateDocument(); 33 | return Verify(document) 34 | .PagesToInclude(pageNumber => pageNumber == 2); 35 | } 36 | 37 | #endregion 38 | 39 | #region GenerateDocument 40 | 41 | static IDocument GenerateDocument() => 42 | Document.Create(container => 43 | { 44 | container.Page(AddPage); 45 | container.Page(AddPage); 46 | }); 47 | 48 | static void AddPage(PageDescriptor page) 49 | { 50 | page.Size(PageSizes.A5); 51 | page.Margin(1, Unit.Centimetre); 52 | page.PageColor(Colors.Grey.Lighten3); 53 | page.DefaultTextStyle(_ => _.FontSize(20)); 54 | 55 | page.Header() 56 | .Text("Hello PDF!") 57 | .SemiBold().FontSize(36); 58 | 59 | page.Content() 60 | .Column(_ => _.Item() 61 | .Text(Placeholders.LoremIpsum())); 62 | 63 | page.Footer() 64 | .AlignCenter() 65 | .Text(_ => 66 | { 67 | _.Span("Page "); 68 | _.CurrentPageNumber(); 69 | }); 70 | } 71 | 72 | #endregion 73 | } -------------------------------------------------------------------------------- /src/Verify.QuestPDF/VerifyQuestPdf.cs: -------------------------------------------------------------------------------- 1 | namespace VerifyTests; 2 | 3 | public static class VerifyQuestPdf 4 | { 5 | public static bool Initialized { get; private set; } 6 | 7 | public static void Initialize() 8 | { 9 | if (Initialized) 10 | { 11 | throw new("Already Initialized"); 12 | } 13 | 14 | Initialized = true; 15 | 16 | InnerVerifier.ThrowIfVerifyHasBeenRun(); 17 | VerifierSettings 18 | .AddExtraSettings( 19 | _ => 20 | { 21 | _.Converters.Add(new DocumentMetadataConverter()); 22 | _.Converters.Add(new DocumentSettingsConverter()); 23 | }); 24 | VerifierSettings.RegisterFileConverter( 25 | conversion: (document, settings) => 26 | { 27 | var pages = document.GenerateImages().ToList(); 28 | 29 | var targets = new List(); 30 | if (!settings.GetPagesToInclude(out var pagesToInclude)) 31 | { 32 | pagesToInclude = _ => true; 33 | } 34 | 35 | for (var index = 0; index < pages.Count; index++) 36 | { 37 | if (pagesToInclude(index + 1)) 38 | { 39 | var page = pages[index]; 40 | var stream = new MemoryStream(page); 41 | targets.Add(new("png", stream)); 42 | } 43 | } 44 | 45 | return new( 46 | info: new 47 | { 48 | Pages = pages.Count, 49 | Metadata = document.GetMetadata(), 50 | Settings = document.GetSettings(), 51 | }, 52 | targets); 53 | }); 54 | } 55 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug fix 3 | about: Create a bug fix to help us improve 4 | --- 5 | 6 | Note: New issues raised, where it is clear the submitter has not read the issue template, are likely to be closed with "please read the issue template". Please don't take offense at this. It is simply a time management decision. If someone raises an issue, and can't be bothered to spend the time to read the issue template, then the project maintainers should not be expected to spend the time to read the submitted issue. Often too much time is spent going back and forth in issue comments asking for information that is outlined in the issue template. 7 | 8 | 9 | #### Preamble 10 | 11 | General questions may be better placed [StackOveflow](https://stackoverflow.com/). 12 | 13 | Where relevant, ensure you are using the current stable versions on your development stack. For example: 14 | 15 | * Visual Studio 16 | * [.NET SDK or .NET Core SDK](https://www.microsoft.com/net/download) 17 | * Any related NuGet packages 18 | 19 | Any code or stack traces must be properly formatted with [GitHub markdown](https://guides.github.com/features/mastering-markdown/). 20 | 21 | 22 | #### Describe the bug 23 | 24 | A clear and concise description of what the bug is. Include any relevant version information. 25 | 26 | A clear and concise description of what you expected to happen. 27 | 28 | Add any other context about the problem here. 29 | 30 | 31 | #### Minimal Repro 32 | 33 | Ensure you have replicated the bug in a minimal solution with the fewest moving parts. Often this will help point to the true cause of the problem. Upload this repro as part of the issue, preferably a public GitHub repository or a downloadable zip. The repro will allow the maintainers of this project to smoke test the any fix. 34 | 35 | #### Submit a PR that fixes the bug 36 | 37 | Submit a [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/) that fixes the bug. Include in this PR a test that verifies the fix. If you were not able to fix the bug, a PR that illustrates your partial progress will suffice. 38 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Verify.QuestPDF 2 | 3 | [![Discussions](https://img.shields.io/badge/Verify-Discussions-yellow?svg=true&label=)](https://github.com/orgs/VerifyTests/discussions) 4 | [![Build status](https://ci.appveyor.com/api/projects/status/au00qrkik2isl8vw?svg=true)](https://ci.appveyor.com/project/SimonCropp/Verify-QuestPDF) 5 | [![NuGet Status](https://img.shields.io/nuget/v/Verify.QuestPDF.svg)](https://www.nuget.org/packages/Verify.QuestPDF/) 6 | 7 | Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of documents via [QuestPDF](https://www.questpdf.com/). 8 | 9 | **See [Milestones](../../milestones?state=closed) for release notes.** 10 | 11 | Designed to help assert the output of projects using QuestPDF to generate PDFs. 12 | 13 | 14 | ## Sponsors 15 | 16 | 17 | ### Entity Framework Extensions 18 | 19 | [Entity Framework Extensions](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.QuestPDF) is a major sponsor and is proud to contribute to the development this project. 20 | 21 | [![Entity Framework Extensions](https://raw.githubusercontent.com/VerifyTests/Verify.QuestPDF/refs/heads/main/docs/zzz.png)](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.QuestPDF) 22 | 23 | 24 | ## NuGet 25 | 26 | * https://nuget.org/packages/Verify.QuestPDF 27 | 28 | 29 | ## Usage 30 | 31 | 32 | 33 | ```cs 34 | [ModuleInitializer] 35 | public static void Init() 36 | { 37 | VerifyImageMagick.RegisterComparers(0.015); 38 | VerifyQuestPdf.Initialize(); 39 | } 40 | ``` 41 | snippet source | anchor 42 | 43 | 44 | This sample uses [Verify.ImageMagick](https://github.com/VerifyTests/Verify.ImageMagick) to ignore small rendering differences that are expected between differens operating systesm. 45 | 46 | Other [compares](https://github.com/VerifyTests/Verify/blob/main/docs/comparer.md) options: 47 | 48 | * https://github.com/VerifyTests/Verify.ImageHash 49 | * https://github.com/VerifyTests/Verify.ImageMagick 50 | * https://github.com/VerifyTests/Verify.Phash 51 | * https://github.com/VerifyTests/Verify.ImageSharp.Compare 52 | 53 | 54 | ### Code that generates a document 55 | 56 | 57 | 58 | ```cs 59 | static IDocument GenerateDocument() => 60 | Document.Create(container => 61 | { 62 | container.Page(AddPage); 63 | container.Page(AddPage); 64 | }); 65 | 66 | static void AddPage(PageDescriptor page) 67 | { 68 | page.Size(PageSizes.A5); 69 | page.Margin(1, Unit.Centimetre); 70 | page.PageColor(Colors.Grey.Lighten3); 71 | page.DefaultTextStyle(_ => _.FontSize(20)); 72 | 73 | page.Header() 74 | .Text("Hello PDF!") 75 | .SemiBold().FontSize(36); 76 | 77 | page.Content() 78 | .Column(_ => _.Item() 79 | .Text(Placeholders.LoremIpsum())); 80 | 81 | page.Footer() 82 | .AlignCenter() 83 | .Text(_ => 84 | { 85 | _.Span("Page "); 86 | _.CurrentPageNumber(); 87 | }); 88 | } 89 | ``` 90 | snippet source | anchor 91 | 92 | 93 | 94 | ### Verify a Document 95 | 96 | 97 | 98 | ```cs 99 | [Test] 100 | public Task VerifyDocument() 101 | { 102 | var document = GenerateDocument(); 103 | return Verify(document); 104 | } 105 | ``` 106 | snippet source | anchor 107 | 108 | 109 | 110 | ### Results 111 | 112 | 113 | #### Metadata 114 | 115 | 116 | 117 | ```txt 118 | { 119 | Pages: 2, 120 | Metadata: { 121 | CreationDate: DateTimeOffset_1, 122 | ModifiedDate: DateTimeOffset_2 123 | }, 124 | Settings: { 125 | ContentDirection: LeftToRight, 126 | PDFA_Conformance: None, 127 | PDFUA_Conformance: None, 128 | ImageCompressionQuality: High, 129 | ImageRasterDpi: 288 130 | } 131 | } 132 | ``` 133 | snippet source | anchor 134 | 135 | 136 | 137 | #### Pdf as image 138 | 139 | 140 | 141 | 142 | ## PagesToInclude 143 | 144 | To render only a defined number of pages at the start of a document: 145 | 146 | 147 | 148 | ```cs 149 | [Test] 150 | public Task PagesToInclude() 151 | { 152 | var document = GenerateDocument(); 153 | return Verify(document) 154 | .PagesToInclude(1); 155 | } 156 | ``` 157 | snippet source | anchor 158 | 159 | 160 | 161 | ### Dynamic 162 | 163 | To dynamically control what pages are rendered: 164 | 165 | 166 | 167 | ```cs 168 | [Test] 169 | public Task PagesToIncludeDynamic() 170 | { 171 | var document = GenerateDocument(); 172 | return Verify(document) 173 | .PagesToInclude(pageNumber => pageNumber == 2); 174 | } 175 | ``` 176 | snippet source | anchor 177 | 178 | -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | end_of_line = lf 6 | insert_final_newline = true 7 | 8 | [*.cs] 9 | indent_size = 4 10 | charset = utf-8 11 | 12 | # Redundant accessor body 13 | resharper_redundant_accessor_body_highlighting = error 14 | 15 | # Replace with field keyword 16 | resharper_replace_with_field_keyword_highlighting = error 17 | 18 | # Replace with single call to Single(..) 19 | resharper_replace_with_single_call_to_single_highlighting = error 20 | 21 | # Replace with single call to SingleOrDefault(..) 22 | resharper_replace_with_single_call_to_single_or_default_highlighting = error 23 | 24 | # Replace with single call to LastOrDefault(..) 25 | resharper_replace_with_single_call_to_last_or_default_highlighting = error 26 | 27 | # Element is localizable 28 | resharper_localizable_element_highlighting = none 29 | 30 | # Replace with single call to Last(..) 31 | resharper_replace_with_single_call_to_last_highlighting = error 32 | 33 | # Replace with single call to First(..) 34 | resharper_replace_with_single_call_to_first_highlighting = error 35 | 36 | # Replace with single call to FirstOrDefault(..) 37 | resharper_replace_with_single_call_to_first_or_default_highlighting = error 38 | 39 | # Replace with single call to Any(..) 40 | resharper_replace_with_single_call_to_any_highlighting = error 41 | 42 | # Simplify negative equality expression 43 | resharper_negative_equality_expression_highlighting = error 44 | 45 | # Replace with single call to Count(..) 46 | resharper_replace_with_single_call_to_count_highlighting = error 47 | 48 | # Declare types in namespaces 49 | dotnet_diagnostic.CA1050.severity = none 50 | 51 | # Use Literals Where Appropriate 52 | dotnet_diagnostic.CA1802.severity = error 53 | 54 | # Template should be a static expression 55 | dotnet_diagnostic.CA2254.severity = error 56 | 57 | # Potentially misleading parameter name in lambda or local function 58 | resharper_all_underscore_local_parameter_name_highlighting = none 59 | 60 | # Redundant explicit collection creation in argument of 'params' parameter 61 | resharper_redundant_explicit_params_array_creation_highlighting = error 62 | 63 | # Do not initialize unnecessarily 64 | dotnet_diagnostic.CA1805.severity = error 65 | 66 | # Avoid unsealed attributes 67 | dotnet_diagnostic.CA1813.severity = error 68 | 69 | # Test for empty strings using string length 70 | dotnet_diagnostic.CA1820.severity = none 71 | 72 | # Remove empty finalizers 73 | dotnet_diagnostic.CA1821.severity = error 74 | 75 | # Mark members as static 76 | dotnet_diagnostic.CA1822.severity = error 77 | 78 | # Avoid unused private fields 79 | dotnet_diagnostic.CA1823.severity = error 80 | 81 | # Avoid zero-length array allocations 82 | dotnet_diagnostic.CA1825.severity = error 83 | 84 | # Use property instead of Linq Enumerable method 85 | dotnet_diagnostic.CA1826.severity = error 86 | 87 | # Do not use Count()/LongCount() when Any() can be used 88 | dotnet_diagnostic.CA1827.severity = error 89 | dotnet_diagnostic.CA1828.severity = error 90 | 91 | # Use Length/Count property instead of Enumerable.Count method 92 | dotnet_diagnostic.CA1829.severity = error 93 | 94 | # Prefer strongly-typed Append and Insert method overloads on StringBuilder 95 | dotnet_diagnostic.CA1830.severity = error 96 | 97 | # Use AsSpan instead of Range-based indexers for string when appropriate 98 | dotnet_diagnostic.CA1831.severity = error 99 | 100 | # Use AsSpan instead of Range-based indexers for string when appropriate 101 | dotnet_diagnostic.CA1831.severity = error 102 | dotnet_diagnostic.CA1832.severity = error 103 | dotnet_diagnostic.CA1833.severity = error 104 | 105 | # Use StringBuilder.Append(char) for single character strings 106 | dotnet_diagnostic.CA1834.severity = error 107 | 108 | # Prefer IsEmpty over Count when available 109 | dotnet_diagnostic.CA1836.severity = error 110 | 111 | # Prefer IsEmpty over Count when available 112 | dotnet_diagnostic.CA1836.severity = error 113 | 114 | # Use Environment.ProcessId instead of Process.GetCurrentProcess().Id 115 | dotnet_diagnostic.CA1837.severity = error 116 | 117 | # Use Environment.ProcessPath instead of Process.GetCurrentProcess().MainModule.FileName 118 | dotnet_diagnostic.CA1839.severity = error 119 | 120 | # Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId 121 | dotnet_diagnostic.CA1840.severity = error 122 | 123 | # Prefer Dictionary Contains methods 124 | dotnet_diagnostic.CA1841.severity = error 125 | 126 | # Do not use WhenAll with a single task 127 | dotnet_diagnostic.CA1842.severity = error 128 | 129 | # Do not use WhenAll/WaitAll with a single task 130 | dotnet_diagnostic.CA1842.severity = error 131 | dotnet_diagnostic.CA1843.severity = error 132 | 133 | # Use span-based 'string.Concat' 134 | dotnet_diagnostic.CA1845.severity = error 135 | 136 | # Prefer AsSpan over Substring 137 | dotnet_diagnostic.CA1846.severity = error 138 | 139 | # Use string.Contains(char) instead of string.Contains(string) with single characters 140 | dotnet_diagnostic.CA1847.severity = error 141 | 142 | # Prefer static HashData method over ComputeHash 143 | dotnet_diagnostic.CA1850.severity = error 144 | 145 | # Possible multiple enumerations of IEnumerable collection 146 | dotnet_diagnostic.CA1851.severity = error 147 | 148 | # Unnecessary call to Dictionary.ContainsKey(key) 149 | dotnet_diagnostic.CA1853.severity = error 150 | 151 | # Prefer the IDictionary.TryGetValue(TKey, out TValue) method 152 | dotnet_diagnostic.CA1854.severity = error 153 | 154 | # Use Span.Clear() instead of Span.Fill() 155 | dotnet_diagnostic.CA1855.severity = error 156 | 157 | # Incorrect usage of ConstantExpected attribute 158 | dotnet_diagnostic.CA1856.severity = error 159 | 160 | # The parameter expects a constant for optimal performance 161 | dotnet_diagnostic.CA1857.severity = error 162 | 163 | # Use StartsWith instead of IndexOf 164 | dotnet_diagnostic.CA1858.severity = error 165 | 166 | # Avoid using Enumerable.Any() extension method 167 | dotnet_diagnostic.CA1860.severity = error 168 | 169 | # Avoid constant arrays as arguments 170 | dotnet_diagnostic.CA1861.severity = error 171 | 172 | # Use the StringComparison method overloads to perform case-insensitive string comparisons 173 | dotnet_diagnostic.CA1862.severity = error 174 | 175 | # Prefer the IDictionary.TryAdd(TKey, TValue) method 176 | dotnet_diagnostic.CA1864.severity = error 177 | 178 | # Use string.Method(char) instead of string.Method(string) for string with single char 179 | dotnet_diagnostic.CA1865.severity = error 180 | dotnet_diagnostic.CA1866.severity = error 181 | dotnet_diagnostic.CA1867.severity = error 182 | 183 | # Unnecessary call to 'Contains' for sets 184 | dotnet_diagnostic.CA1868.severity = error 185 | 186 | # Cache and reuse 'JsonSerializerOptions' instances 187 | dotnet_diagnostic.CA1869.severity = error 188 | 189 | # Use a cached 'SearchValues' instance 190 | dotnet_diagnostic.CA1870.severity = error 191 | 192 | # Microsoft .NET properties 193 | trim_trailing_whitespace = true 194 | csharp_preferred_modifier_order = public, private, protected, internal, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async:suggestion 195 | resharper_namespace_body = file_scoped 196 | dotnet_naming_rule.private_constants_rule.severity = warning 197 | dotnet_naming_rule.private_constants_rule.style = lower_camel_case_style 198 | dotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols 199 | dotnet_naming_rule.private_instance_fields_rule.severity = warning 200 | dotnet_naming_rule.private_instance_fields_rule.style = lower_camel_case_style 201 | dotnet_naming_rule.private_instance_fields_rule.symbols = private_instance_fields_symbols 202 | dotnet_naming_rule.private_static_fields_rule.severity = warning 203 | dotnet_naming_rule.private_static_fields_rule.style = lower_camel_case_style 204 | dotnet_naming_rule.private_static_fields_rule.symbols = private_static_fields_symbols 205 | dotnet_naming_rule.private_static_readonly_rule.severity = warning 206 | dotnet_naming_rule.private_static_readonly_rule.style = lower_camel_case_style 207 | dotnet_naming_rule.private_static_readonly_rule.symbols = private_static_readonly_symbols 208 | dotnet_naming_style.lower_camel_case_style.capitalization = camel_case 209 | dotnet_naming_style.upper_camel_case_style.capitalization = pascal_case 210 | dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private 211 | dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field 212 | dotnet_naming_symbols.private_constants_symbols.required_modifiers = const 213 | dotnet_naming_symbols.private_instance_fields_symbols.applicable_accessibilities = private 214 | dotnet_naming_symbols.private_instance_fields_symbols.applicable_kinds = field 215 | dotnet_naming_symbols.private_static_fields_symbols.applicable_accessibilities = private 216 | dotnet_naming_symbols.private_static_fields_symbols.applicable_kinds = field 217 | dotnet_naming_symbols.private_static_fields_symbols.required_modifiers = static 218 | dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private 219 | dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field 220 | dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static, readonly 221 | dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none 222 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none 223 | dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none 224 | 225 | # ReSharper properties 226 | resharper_object_creation_when_type_not_evident = target_typed 227 | 228 | # ReSharper inspection severities 229 | resharper_arrange_object_creation_when_type_evident_highlighting = error 230 | resharper_arrange_object_creation_when_type_not_evident_highlighting = error 231 | resharper_arrange_redundant_parentheses_highlighting = error 232 | resharper_arrange_static_member_qualifier_highlighting = error 233 | resharper_arrange_this_qualifier_highlighting = error 234 | resharper_arrange_type_member_modifiers_highlighting = none 235 | resharper_built_in_type_reference_style_for_member_access_highlighting = hint 236 | resharper_built_in_type_reference_style_highlighting = hint 237 | resharper_check_namespace_highlighting = none 238 | resharper_convert_to_using_declaration_highlighting = error 239 | resharper_field_can_be_made_read_only_local_highlighting = none 240 | resharper_merge_into_logical_pattern_highlighting = warning 241 | resharper_merge_into_pattern_highlighting = error 242 | resharper_method_has_async_overload_highlighting = warning 243 | # because stop rider giving errors before source generators have run 244 | resharper_partial_type_with_single_part_highlighting = warning 245 | resharper_redundant_base_qualifier_highlighting = warning 246 | resharper_redundant_cast_highlighting = error 247 | resharper_redundant_empty_object_creation_argument_list_highlighting = error 248 | resharper_redundant_empty_object_or_collection_initializer_highlighting = error 249 | resharper_redundant_name_qualifier_highlighting = error 250 | resharper_redundant_suppress_nullable_warning_expression_highlighting = error 251 | resharper_redundant_using_directive_highlighting = error 252 | resharper_redundant_verbatim_string_prefix_highlighting = error 253 | resharper_redundant_lambda_signature_parentheses_highlighting = error 254 | resharper_replace_substring_with_range_indexer_highlighting = warning 255 | resharper_suggest_var_or_type_built_in_types_highlighting = error 256 | resharper_suggest_var_or_type_elsewhere_highlighting = error 257 | resharper_suggest_var_or_type_simple_types_highlighting = error 258 | resharper_unnecessary_whitespace_highlighting = error 259 | resharper_use_await_using_highlighting = warning 260 | resharper_use_deconstruction_highlighting = warning 261 | 262 | # Sort using and Import directives with System.* appearing first 263 | dotnet_sort_system_directives_first = true 264 | 265 | # Avoid "this." and "Me." if not necessary 266 | dotnet_style_qualification_for_field = false:error 267 | dotnet_style_qualification_for_property = false:error 268 | dotnet_style_qualification_for_method = false:error 269 | dotnet_style_qualification_for_event = false:error 270 | 271 | # Use language keywords instead of framework type names for type references 272 | dotnet_style_predefined_type_for_locals_parameters_members = true:error 273 | dotnet_style_predefined_type_for_member_access = true:error 274 | 275 | # Suggest more modern language features when available 276 | dotnet_style_object_initializer = true:error 277 | dotnet_style_collection_initializer = true:error 278 | dotnet_style_coalesce_expression = false:error 279 | dotnet_style_null_propagation = true:error 280 | dotnet_style_explicit_tuple_names = true:error 281 | 282 | # Use collection expression syntax 283 | resharper_use_collection_expression_highlighting = error 284 | 285 | # Prefer "var" everywhere 286 | csharp_style_var_for_built_in_types = true:error 287 | csharp_style_var_when_type_is_apparent = true:error 288 | csharp_style_var_elsewhere = true:error 289 | 290 | # Prefer method-like constructs to have a block body 291 | csharp_style_expression_bodied_methods = true:error 292 | csharp_style_expression_bodied_local_functions = true:error 293 | csharp_style_expression_bodied_constructors = true:error 294 | csharp_style_expression_bodied_operators = true:error 295 | resharper_place_expr_method_on_single_line = false 296 | 297 | # Prefer property-like constructs to have an expression-body 298 | csharp_style_expression_bodied_properties = true:error 299 | csharp_style_expression_bodied_indexers = true:error 300 | csharp_style_expression_bodied_accessors = true:error 301 | 302 | # Suggest more modern language features when available 303 | csharp_style_pattern_matching_over_is_with_cast_check = true:error 304 | csharp_style_pattern_matching_over_as_with_null_check = true:error 305 | csharp_style_inlined_variable_declaration = true:suggestion 306 | csharp_style_throw_expression = true:suggestion 307 | csharp_style_conditional_delegate_call = true:suggestion 308 | 309 | # Newline settings 310 | #csharp_new_line_before_open_brace = all:error 311 | resharper_max_array_initializer_elements_on_line = 1 312 | csharp_new_line_before_else = true 313 | csharp_new_line_before_catch = true 314 | csharp_new_line_before_finally = true 315 | csharp_new_line_before_members_in_object_initializers = true 316 | csharp_new_line_before_members_in_anonymous_types = true 317 | resharper_wrap_before_first_type_parameter_constraint = true 318 | resharper_wrap_extends_list_style = chop_always 319 | resharper_wrap_after_dot_in_method_calls = false 320 | resharper_wrap_before_binary_pattern_op = false 321 | resharper_wrap_object_and_collection_initializer_style = chop_always 322 | resharper_place_simple_initializer_on_single_line = false 323 | 324 | # space 325 | resharper_space_around_lambda_arrow = true 326 | 327 | dotnet_style_require_accessibility_modifiers = never:error 328 | resharper_place_type_constraints_on_same_line = false 329 | resharper_blank_lines_inside_namespace = 0 330 | resharper_blank_lines_after_file_scoped_namespace_directive = 1 331 | resharper_blank_lines_inside_type = 0 332 | 333 | insert_final_newline = false 334 | resharper_place_attribute_on_same_line = false 335 | 336 | #braces https://www.jetbrains.com/help/resharper/EditorConfig_CSHARP_CSharpCodeStylePageImplSchema.html#Braces 337 | resharper_braces_for_ifelse = required 338 | resharper_braces_for_foreach = required 339 | resharper_braces_for_while = required 340 | resharper_braces_for_dowhile = required 341 | resharper_braces_for_lock = required 342 | resharper_braces_for_fixed = required 343 | resharper_braces_for_for = required 344 | 345 | resharper_return_value_of_pure_method_is_not_used_highlighting = error 346 | 347 | 348 | resharper_misleading_body_like_statement_highlighting = error 349 | 350 | resharper_redundant_record_class_keyword_highlighting = error 351 | 352 | resharper_redundant_extends_list_entry_highlighting = error 353 | 354 | resharper_redundant_type_arguments_inside_nameof_highlighting = error 355 | 356 | # Xml files 357 | [*.{xml,config,nuspec,resx,vsixmanifest,csproj,targets,props,fsproj}] 358 | indent_size = 2 359 | # https://www.jetbrains.com/help/resharper/EditorConfig_XML_XmlCodeStylePageSchema.html#resharper_xml_blank_line_after_pi 360 | resharper_blank_line_after_pi = false 361 | resharper_space_before_self_closing = true 362 | ij_xml_space_inside_empty_tag = true 363 | 364 | [*.json] 365 | indent_size = 2 366 | 367 | # Verify settings 368 | [*.{received,verified}.{txt,xml,json,md,sql,csv,html,htm,nuspec,rels}] 369 | charset = utf-8-bom 370 | end_of_line = lf 371 | indent_size = unset 372 | indent_style = unset 373 | insert_final_newline = false 374 | tab_width = unset 375 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /src/Shared.sln.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | False 3 | Quiet 4 | True 5 | True 6 | True 7 | DO_NOT_SHOW 8 | ERROR 9 | ERROR 10 | ERROR 11 | WARNING 12 | ERROR 13 | ERROR 14 | ERROR 15 | ERROR 16 | ERROR 17 | ERROR 18 | ERROR 19 | ERROR 20 | ERROR 21 | ERROR 22 | ERROR 23 | ERROR 24 | ERROR 25 | ERROR 26 | ERROR 27 | ERROR 28 | ERROR 29 | ERROR 30 | ERROR 31 | ERROR 32 | ERROR 33 | ERROR 34 | ERROR 35 | ERROR 36 | ERROR 37 | ERROR 38 | ERROR 39 | ERROR 40 | ERROR 41 | ERROR 42 | ERROR 43 | DO_NOT_SHOW 44 | DO_NOT_SHOW 45 | ERROR 46 | ERROR 47 | ERROR 48 | ERROR 49 | ERROR 50 | ERROR 51 | ERROR 52 | ERROR 53 | ERROR 54 | ERROR 55 | ERROR 56 | ERROR 57 | C90+,E79+,S14+ 58 | ERROR 59 | ERROR 60 | ERROR 61 | ERROR 62 | ERROR 63 | ERROR 64 | ERROR 65 | ERROR 66 | ERROR 67 | ERROR 68 | ERROR 69 | ERROR 70 | ERROR 71 | ERROR 72 | ERROR 73 | ERROR 74 | ERROR 75 | ERROR 76 | ERROR 77 | ERROR 78 | ERROR 79 | ERROR 80 | ERROR 81 | ERROR 82 | ERROR 83 | ERROR 84 | ERROR 85 | ERROR 86 | ERROR 87 | ERROR 88 | ERROR 89 | ERROR 90 | ERROR 91 | ERROR 92 | ERROR 93 | ERROR 94 | ERROR 95 | ERROR 96 | ERROR 97 | ERROR 98 | ERROR 99 | ERROR 100 | ERROR 101 | ERROR 102 | ERROR 103 | ERROR 104 | ERROR 105 | ERROR 106 | ERROR 107 | ERROR 108 | ERROR 109 | ERROR 110 | ERROR 111 | ERROR 112 | ERROR 113 | ERROR 114 | ERROR 115 | ERROR 116 | ERROR 117 | ERROR 118 | ERROR 119 | ERROR 120 | ERROR 121 | ERROR 122 | DO_NOT_SHOW 123 | *.received.* 124 | *.verified.* 125 | ERROR 126 | ERROR 127 | DO_NOT_SHOW 128 | ECMAScript 2016 129 | <?xml version="1.0" encoding="utf-16"?><Profile name="c# Cleanup"><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><CSCodeStyleAttributes ArrangeVarStyle="True" ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeCodeBodyStyle="True" ArrangeTrailingCommas="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeNamespaces="True" /><CssAlphabetizeProperties>True</CssAlphabetizeProperties><JSStringLiteralQuotesDescriptor>True</JSStringLiteralQuotesDescriptor><CorrectVariableKindsDescriptor>True</CorrectVariableKindsDescriptor><VariablesToInnerScopesDescriptor>True</VariablesToInnerScopesDescriptor><StringToTemplatesDescriptor>True</StringToTemplatesDescriptor><JsInsertSemicolon>True</JsInsertSemicolon><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><OptimizeImportsTs>True</OptimizeImportsTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><AsInsteadOfCastTs>True</AsInsteadOfCastTs><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CssReformatCode>True</CssReformatCode><JsReformatCode>True</JsReformatCode><JsFormatDocComments>True</JsFormatDocComments><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><HtmlReformatCode>True</HtmlReformatCode><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><IDEA_SETTINGS>&lt;profile version="1.0"&gt; 130 | &lt;option name="myName" value="c# Cleanup" /&gt; 131 | &lt;/profile&gt;</IDEA_SETTINGS><RIDER_SETTINGS>&lt;profile&gt; 132 | &lt;Language id="EditorConfig"&gt; 133 | &lt;Reformat&gt;false&lt;/Reformat&gt; 134 | &lt;/Language&gt; 135 | &lt;Language id="HTML"&gt; 136 | &lt;OptimizeImports&gt;false&lt;/OptimizeImports&gt; 137 | &lt;Reformat&gt;false&lt;/Reformat&gt; 138 | &lt;Rearrange&gt;false&lt;/Rearrange&gt; 139 | &lt;/Language&gt; 140 | &lt;Language id="JSON"&gt; 141 | &lt;Reformat&gt;false&lt;/Reformat&gt; 142 | &lt;/Language&gt; 143 | &lt;Language id="RELAX-NG"&gt; 144 | &lt;Reformat&gt;false&lt;/Reformat&gt; 145 | &lt;/Language&gt; 146 | &lt;Language id="XML"&gt; 147 | &lt;OptimizeImports&gt;false&lt;/OptimizeImports&gt; 148 | &lt;Reformat&gt;false&lt;/Reformat&gt; 149 | &lt;Rearrange&gt;false&lt;/Rearrange&gt; 150 | &lt;/Language&gt; 151 | &lt;/profile&gt;</RIDER_SETTINGS></Profile> 152 | ExpressionBody 153 | ExpressionBody 154 | ExpressionBody 155 | False 156 | NEVER 157 | NEVER 158 | False 159 | False 160 | False 161 | True 162 | False 163 | CHOP_ALWAYS 164 | False 165 | False 166 | RemoveIndent 167 | RemoveIndent 168 | False 169 | True 170 | True 171 | True 172 | True 173 | True 174 | ERROR 175 | DoNothing 176 | --------------------------------------------------------------------------------