Browse Source

Add [ExcludeFromCodeCoverage] attribute to obsolete methods for improved test coverage reporting

Marcin Ziąbek 2 months ago
parent
commit
bd97768e75

+ 5 - 0
Source/QuestPDF/Companion/Previewer.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using QuestPDF.Companion;
 using QuestPDF.Companion;
@@ -14,12 +15,14 @@ public static class PreviewerExtensions
     #if NET6_0_OR_GREATER
     #if NET6_0_OR_GREATER
     
     
     [Obsolete(ObsoleteMessage)]
     [Obsolete(ObsoleteMessage)]
+    [ExcludeFromCodeCoverage]
     public static void ShowInPreviewer(this IDocument document, int port = 12500)
     public static void ShowInPreviewer(this IDocument document, int port = 12500)
     {
     {
         throw new NotImplementedException(ObsoleteMessage);
         throw new NotImplementedException(ObsoleteMessage);
     }
     }
     
     
     [Obsolete(ObsoleteMessage)]
     [Obsolete(ObsoleteMessage)]
+    [ExcludeFromCodeCoverage]
     public static Task ShowInPreviewerAsync(this IDocument document, int port = 12500, CancellationToken cancellationToken = default)
     public static Task ShowInPreviewerAsync(this IDocument document, int port = 12500, CancellationToken cancellationToken = default)
     {
     {
         throw new NotImplementedException(ObsoleteMessage);
         throw new NotImplementedException(ObsoleteMessage);
@@ -28,12 +31,14 @@ public static class PreviewerExtensions
     #else
     #else
 
 
     [Obsolete(ObsoleteMessage)]
     [Obsolete(ObsoleteMessage)]
+    [ExcludeFromCodeCoverage]
     public static void ShowInPreviewer(this IDocument document, int port = 12500)
     public static void ShowInPreviewer(this IDocument document, int port = 12500)
     {
     {
         throw new NotSupportedException(ObsoleteMessage);
         throw new NotSupportedException(ObsoleteMessage);
     }
     }
 
 
     [Obsolete(ObsoleteMessage)]
     [Obsolete(ObsoleteMessage)]
+    [ExcludeFromCodeCoverage]
     public static async Task ShowInPreviewerAsync(this IDocument document, int port = 12500, CancellationToken cancellationToken = default)
     public static async Task ShowInPreviewerAsync(this IDocument document, int port = 12500, CancellationToken cancellationToken = default)
     {
     {
         throw new NotSupportedException(ObsoleteMessage);
         throw new NotSupportedException(ObsoleteMessage);

+ 2 - 0
Source/QuestPDF/Drawing/FontManager.cs

@@ -1,5 +1,6 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
@@ -26,6 +27,7 @@ namespace QuestPDF.Drawing
         }
         }
         
         
         [Obsolete("Since version 2022.8 this method has been renamed. Please use the RegisterFontWithCustomName method.")]
         [Obsolete("Since version 2022.8 this method has been renamed. Please use the RegisterFontWithCustomName method.")]
+        [ExcludeFromCodeCoverage]
         public static void RegisterFontType(string fontName, Stream stream)
         public static void RegisterFontType(string fontName, Stream stream)
         {
         {
             RegisterFontWithCustomName(fontName, stream);
             RegisterFontWithCustomName(fontName, stream);

+ 2 - 0
Source/QuestPDF/Fluent/ColumnExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using QuestPDF.Elements;
 using QuestPDF.Elements;
 using QuestPDF.Infrastructure;
 using QuestPDF.Infrastructure;
 
 
@@ -34,6 +35,7 @@ namespace QuestPDF.Fluent
     public static class ColumnExtensions
     public static class ColumnExtensions
     {
     {
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'Column' method.")]
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'Column' method.")]
+        [ExcludeFromCodeCoverage]
         public static void Stack(this IContainer element, Action<ColumnDescriptor> handler)
         public static void Stack(this IContainer element, Action<ColumnDescriptor> handler)
         {
         {
             element.Column(handler);
             element.Column(handler);

+ 5 - 0
Source/QuestPDF/Fluent/DecorationExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using QuestPDF.Drawing.Exceptions;
 using QuestPDF.Drawing.Exceptions;
 using QuestPDF.Elements;
 using QuestPDF.Elements;
 using QuestPDF.Infrastructure;
 using QuestPDF.Infrastructure;
@@ -93,6 +94,7 @@ namespace QuestPDF.Fluent
         #region Obsolete
         #region Obsolete
 
 
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'Before' method.")]
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'Before' method.")]
+        [ExcludeFromCodeCoverage]
         public IContainer Header()
         public IContainer Header()
         {
         {
             var container = new Container();
             var container = new Container();
@@ -101,12 +103,14 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'Before' method.")]
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'Before' method.")]
+        [ExcludeFromCodeCoverage]
         public void Header(Action<IContainer> handler)
         public void Header(Action<IContainer> handler)
         {
         {
             handler?.Invoke(Header());
             handler?.Invoke(Header());
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'After' method.")]
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'After' method.")]
+        [ExcludeFromCodeCoverage]
         public IContainer Footer()
         public IContainer Footer()
         {
         {
             var container = new Container();
             var container = new Container();
@@ -115,6 +119,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'After' method.")]
         [Obsolete("This element has been renamed since version 2022.2. Please use the 'After' method.")]
+        [ExcludeFromCodeCoverage]
         public void Footer(Action<IContainer> handler)
         public void Footer(Action<IContainer> handler)
         {
         {
             handler?.Invoke(Footer());
             handler?.Invoke(Footer());

+ 5 - 0
Source/QuestPDF/Fluent/ElementExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using System.Net.Mime;
 using System.Net.Mime;
 using System.Runtime.CompilerServices;
 using System.Runtime.CompilerServices;
 using QuestPDF.Drawing.Exceptions;
 using QuestPDF.Drawing.Exceptions;
@@ -271,6 +272,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the Hyperlink method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the Hyperlink method.")]
+        [ExcludeFromCodeCoverage]
         public static IContainer ExternalLink(this IContainer element, string url)
         public static IContainer ExternalLink(this IContainer element, string url)
         {
         {
             return element.Hyperlink(url);
             return element.Hyperlink(url);
@@ -290,6 +292,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the Section method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the Section method.")]
+        [ExcludeFromCodeCoverage]
         public static IContainer Location(this IContainer element, string locationName)
         public static IContainer Location(this IContainer element, string locationName)
         {
         {
             return element.Section(locationName);
             return element.Section(locationName);
@@ -316,6 +319,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the SectionLink method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the SectionLink method.")]
+        [ExcludeFromCodeCoverage]
         public static IContainer InternalLink(this IContainer element, string locationName)
         public static IContainer InternalLink(this IContainer element, string locationName)
         {
         {
             return element.SectionLink(locationName);
             return element.SectionLink(locationName);
@@ -508,6 +512,7 @@ namespace QuestPDF.Fluent
         public delegate void DrawOnCanvas(object canvas, Size availableSpace);
         public delegate void DrawOnCanvas(object canvas, Size availableSpace);
         
         
         [Obsolete(CanvasDeprecatedMessage)]
         [Obsolete(CanvasDeprecatedMessage)]
+        [ExcludeFromCodeCoverage]
         public static void Canvas(this IContainer element, DrawOnCanvas handler)
         public static void Canvas(this IContainer element, DrawOnCanvas handler)
         {
         {
             throw new NotImplementedException(CanvasDeprecatedMessage);
             throw new NotImplementedException(CanvasDeprecatedMessage);

+ 2 - 0
Source/QuestPDF/Fluent/GridExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using QuestPDF.Elements;
 using QuestPDF.Elements;
 using QuestPDF.Infrastructure;
 using QuestPDF.Infrastructure;
 
 
@@ -68,6 +69,7 @@ namespace QuestPDF.Fluent
     public static class GridExtensions
     public static class GridExtensions
     {
     {
         [Obsolete("This element has been deprecated since version 2022.11. Please use the Table element, or the combination of the Row and Column elements.")]
         [Obsolete("This element has been deprecated since version 2022.11. Please use the Table element, or the combination of the Row and Column elements.")]
+        [ExcludeFromCodeCoverage]
         public static void Grid(this IContainer element, Action<GridDescriptor> handler)
         public static void Grid(this IContainer element, Action<GridDescriptor> handler)
         {
         {
             var descriptor = new GridDescriptor();
             var descriptor = new GridDescriptor();

+ 5 - 0
Source/QuestPDF/Fluent/ImageExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using System.IO;
 using System.IO;
 using QuestPDF.Drawing.Exceptions;
 using QuestPDF.Drawing.Exceptions;
 using QuestPDF.Elements;
 using QuestPDF.Elements;
@@ -263,24 +264,28 @@ namespace QuestPDF.Fluent
         #region Obsolete
         #region Obsolete
         
         
         [Obsolete("This element has been changed since version 2023.5. Please use the Image method overload that takes the GenerateDynamicImageDelegate as an argument.")]
         [Obsolete("This element has been changed since version 2023.5. Please use the Image method overload that takes the GenerateDynamicImageDelegate as an argument.")]
+        [ExcludeFromCodeCoverage]
         public static void Image(this IContainer element, Func<Size, byte[]> imageSource)
         public static void Image(this IContainer element, Func<Size, byte[]> imageSource)
         {
         {
             element.Image((ImageSize x) => imageSource(new Size(x.Width, x.Height)));
             element.Image((ImageSize x) => imageSource(new Size(x.Width, x.Height)));
         }
         }
         
         
         [Obsolete("This element has been changed since version 2023.5. Please use the Image method overload that returns the ImageDescriptor object.")]
         [Obsolete("This element has been changed since version 2023.5. Please use the Image method overload that returns the ImageDescriptor object.")]
+        [ExcludeFromCodeCoverage]
         public static void Image(this IContainer parent, byte[] imageData, ImageScaling scaling)
         public static void Image(this IContainer parent, byte[] imageData, ImageScaling scaling)
         {
         {
             parent.Image(imageData).ApplyScaling(scaling);
             parent.Image(imageData).ApplyScaling(scaling);
         }
         }
         
         
         [Obsolete("This element has been changed since version 2023.5. Please use the Image method overload that returns the ImageDescriptor object.")]
         [Obsolete("This element has been changed since version 2023.5. Please use the Image method overload that returns the ImageDescriptor object.")]
+        [ExcludeFromCodeCoverage]
         public static void Image(this IContainer parent, string filePath, ImageScaling scaling)
         public static void Image(this IContainer parent, string filePath, ImageScaling scaling)
         {
         {
             parent.Image(filePath).ApplyScaling(scaling);
             parent.Image(filePath).ApplyScaling(scaling);
         }
         }
         
         
         [Obsolete("This element has been changed since version 2023.5. Please use the Image method overload that returns the ImageDescriptor object.")]
         [Obsolete("This element has been changed since version 2023.5. Please use the Image method overload that returns the ImageDescriptor object.")]
+        [ExcludeFromCodeCoverage]
         public static void Image(this IContainer parent, Stream fileStream, ImageScaling scaling)
         public static void Image(this IContainer parent, Stream fileStream, ImageScaling scaling)
         {
         {
             parent.Image(fileStream).ApplyScaling(scaling);
             parent.Image(fileStream).ApplyScaling(scaling);

+ 3 - 1
Source/QuestPDF/Fluent/PageExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using QuestPDF.Drawing;
 using QuestPDF.Drawing;
 using QuestPDF.Drawing.Exceptions;
 using QuestPDF.Drawing.Exceptions;
 using QuestPDF.Elements;
 using QuestPDF.Elements;
@@ -149,7 +150,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         /// <summary>
         /// <summary>
-        /// Applies a default text style to all <see cref="TextExtensions.Text">Text</see> elements within the page set.
+        /// Applies a default text style to all <see cref="MediaTypeNames.Text">Text</see> elements within the page set.
         /// </summary>
         /// </summary>
         /// <remarks>
         /// <remarks>
         /// Use this method to achieve consistent text styling across entire document.
         /// Use this method to achieve consistent text styling across entire document.
@@ -193,6 +194,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the PageColor method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the PageColor method.")]
+        [ExcludeFromCodeCoverage]
         public void Background(Color color)
         public void Background(Color color)
         {
         {
             PageColor(color);
             PageColor(color);

+ 3 - 0
Source/QuestPDF/Fluent/ShrinkExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using QuestPDF.Elements;
 using QuestPDF.Elements;
 using QuestPDF.Infrastructure;
 using QuestPDF.Infrastructure;
 
 
@@ -55,12 +56,14 @@ namespace QuestPDF.Fluent
         #region Obsolete
         #region Obsolete
 
 
         [Obsolete("This element has been renamed since version 2022.1. Please use the Shrink method.")]
         [Obsolete("This element has been renamed since version 2022.1. Please use the Shrink method.")]
+        [ExcludeFromCodeCoverage]
         public static IContainer Box(this IContainer element)
         public static IContainer Box(this IContainer element)
         {
         {
             return element.Shrink();
             return element.Shrink();
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2023.11. Please use the Shrink method.")]
         [Obsolete("This element has been renamed since version 2023.11. Please use the Shrink method.")]
+        [ExcludeFromCodeCoverage]
         public static IContainer MinimalBox(this IContainer element)
         public static IContainer MinimalBox(this IContainer element)
         {
         {
             return element.Shrink();
             return element.Shrink();

+ 7 - 0
Source/QuestPDF/Fluent/TextExtensions.cs

@@ -1,5 +1,6 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Linq;
 using QuestPDF.Elements;
 using QuestPDF.Elements;
 using QuestPDF.Elements.Text;
 using QuestPDF.Elements.Text;
@@ -229,6 +230,7 @@ namespace QuestPDF.Fluent
         }
         }
 
 
         [Obsolete("This element has been renamed since version 2022.3. Please use the overload that returns a TextSpanDescriptor object which allows to specify text style.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the overload that returns a TextSpanDescriptor object which allows to specify text style.")]
+        [ExcludeFromCodeCoverage]
         public void Span(string? text, TextStyle style)
         public void Span(string? text, TextStyle style)
         {
         {
             Span(text).Style(style);
             Span(text).Style(style);
@@ -294,6 +296,7 @@ namespace QuestPDF.Fluent
         }
         }
 
 
         [Obsolete("This element has been renamed since version 2022.3. Please use the BeginPageNumberOfSection method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the BeginPageNumberOfSection method.")]
+        [ExcludeFromCodeCoverage]
         public void PageNumberOfLocation(string sectionName, TextStyle? style = null)
         public void PageNumberOfLocation(string sectionName, TextStyle? style = null)
         {
         {
             BeginPageNumberOfSection(sectionName).Style(style);
             BeginPageNumberOfSection(sectionName).Style(style);
@@ -369,6 +372,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the SectionLink method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the SectionLink method.")]
+        [ExcludeFromCodeCoverage]
         public void InternalLocation(string? text, string locationName, TextStyle? style = null)
         public void InternalLocation(string? text, string locationName, TextStyle? style = null)
         {
         {
             SectionLink(text, locationName).Style(style);
             SectionLink(text, locationName).Style(style);
@@ -398,6 +402,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the Hyperlink method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the Hyperlink method.")]
+        [ExcludeFromCodeCoverage]
         public void ExternalLocation(string? text, string url, TextStyle? style = null)
         public void ExternalLocation(string? text, string url, TextStyle? style = null)
         {
         {
             Hyperlink(text, url).Style(style);
             Hyperlink(text, url).Style(style);
@@ -464,12 +469,14 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This method has been deprecated since version 2022.3. Please use the overload that returns a TextSpanDescriptor object which allows to specify text style.")]
         [Obsolete("This method has been deprecated since version 2022.3. Please use the overload that returns a TextSpanDescriptor object which allows to specify text style.")]
+        [ExcludeFromCodeCoverage]
         public static void Text(this IContainer element, object? text, TextStyle style)
         public static void Text(this IContainer element, object? text, TextStyle style)
         {
         {
             element.Text(text).Style(style);
             element.Text(text).Style(style);
         }
         }
 
 
         [Obsolete("This method has been deprecated since version 2022.12. Please use an overload where the text parameter is passed explicitly as a string.")]
         [Obsolete("This method has been deprecated since version 2022.12. Please use an overload where the text parameter is passed explicitly as a string.")]
+        [ExcludeFromCodeCoverage]
         public static TextSpanDescriptor Text(this IContainer element, object? text)
         public static TextSpanDescriptor Text(this IContainer element, object? text)
         {
         {
             return element.Text(text?.ToString());
             return element.Text(text?.ToString());

+ 4 - 0
Source/QuestPDF/Fluent/TextSpanDescriptorExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using QuestPDF.Helpers;
 using QuestPDF.Helpers;
 using QuestPDF.Infrastructure;
 using QuestPDF.Infrastructure;
 
 
@@ -17,6 +18,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
         [Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
+        [ExcludeFromCodeCoverage]
         public static T Fallback<T>(this T descriptor, TextStyle? value = null) where T : TextSpanDescriptor
         public static T Fallback<T>(this T descriptor, TextStyle? value = null) where T : TextSpanDescriptor
         {
         {
             descriptor.MutateTextStyle(TextStyleExtensions.Fallback, value);
             descriptor.MutateTextStyle(TextStyleExtensions.Fallback, value);
@@ -24,6 +26,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
         [Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
+        [ExcludeFromCodeCoverage]
         public static T Fallback<T>(this T descriptor, Func<TextStyle, TextStyle> handler) where T : TextSpanDescriptor
         public static T Fallback<T>(this T descriptor, Func<TextStyle, TextStyle> handler) where T : TextSpanDescriptor
         {
         {
             return descriptor.Fallback(handler(TextStyle.Default));
             return descriptor.Fallback(handler(TextStyle.Default));
@@ -89,6 +92,7 @@ namespace QuestPDF.Fluent
 
 
         /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.wrapAnywhere"]/*' />
         /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.wrapAnywhere"]/*' />
         [Obsolete("This setting is not supported since the 2024.3 version. This flag should be handled automatically by the layout engine.")]
         [Obsolete("This setting is not supported since the 2024.3 version. This flag should be handled automatically by the layout engine.")]
+        [ExcludeFromCodeCoverage]
         public static T WrapAnywhere<T>(this T descriptor, bool value = true) where T : TextSpanDescriptor
         public static T WrapAnywhere<T>(this T descriptor, bool value = true) where T : TextSpanDescriptor
         {
         {
             return descriptor;
             return descriptor;

+ 7 - 0
Source/QuestPDF/Fluent/TextStyleExtensions.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Linq;
 using QuestPDF.Helpers;
 using QuestPDF.Helpers;
 using QuestPDF.Infrastructure;
 using QuestPDF.Infrastructure;
@@ -9,6 +10,7 @@ namespace QuestPDF.Fluent
     public static class TextStyleExtensions
     public static class TextStyleExtensions
     {
     {
         [Obsolete("This element has been renamed since version 2022.3. Please use the FontColor method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the FontColor method.")]
+        [ExcludeFromCodeCoverage]
         public static TextStyle Color(this TextStyle style, string value)
         public static TextStyle Color(this TextStyle style, string value)
         {
         {
             return style.FontColor(value);
             return style.FontColor(value);
@@ -31,6 +33,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the FontFamily method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the FontFamily method.")]
+        [ExcludeFromCodeCoverage]
         public static TextStyle FontType(this TextStyle style, string value)
         public static TextStyle FontType(this TextStyle style, string value)
         {
         {
             return style.FontFamily(value);
             return style.FontFamily(value);
@@ -46,6 +49,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the FontSize method.")]
         [Obsolete("This element has been renamed since version 2022.3. Please use the FontSize method.")]
+        [ExcludeFromCodeCoverage]
         public static TextStyle Size(this TextStyle style, float value)
         public static TextStyle Size(this TextStyle style, float value)
         {
         {
             return style.FontSize(value);
             return style.FontSize(value);
@@ -91,6 +95,7 @@ namespace QuestPDF.Fluent
         
         
         /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.wrapAnywhere"]/*' />
         /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.wrapAnywhere"]/*' />
         [Obsolete("This setting is not supported since the 2024.3 version. This flag should be handled automatically by the layout engine.")]
         [Obsolete("This setting is not supported since the 2024.3 version. This flag should be handled automatically by the layout engine.")]
+        [ExcludeFromCodeCoverage]
         public static TextStyle WrapAnywhere(this TextStyle style, bool value = true)
         public static TextStyle WrapAnywhere(this TextStyle style, bool value = true)
         {
         {
             return style;
             return style;
@@ -279,6 +284,7 @@ namespace QuestPDF.Fluent
         #region Fallback
         #region Fallback
         
         
         [Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
         [Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
+        [ExcludeFromCodeCoverage]
         public static TextStyle Fallback(this TextStyle style, TextStyle? value = null)
         public static TextStyle Fallback(this TextStyle style, TextStyle? value = null)
         {
         {
             var currentFontFamilies = style.FontFamilies ?? Array.Empty<string>();
             var currentFontFamilies = style.FontFamilies ?? Array.Empty<string>();
@@ -294,6 +300,7 @@ namespace QuestPDF.Fluent
         }
         }
         
         
         [Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
         [Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
+        [ExcludeFromCodeCoverage]
         public static TextStyle Fallback(this TextStyle style, Func<TextStyle, TextStyle> handler)
         public static TextStyle Fallback(this TextStyle style, Func<TextStyle, TextStyle> handler)
         {
         {
             return style.Fallback(handler(TextStyle.Default));
             return style.Fallback(handler(TextStyle.Default));

+ 7 - 0
Source/QuestPDF/Infrastructure/DocumentMetadata.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Diagnostics.CodeAnalysis;
 
 
 namespace QuestPDF.Infrastructure
 namespace QuestPDF.Infrastructure
 {
 {
@@ -57,6 +58,7 @@ namespace QuestPDF.Infrastructure
         #region Deprecated properties
         #region Deprecated properties
         
         
         [Obsolete("This API has been moved since version 2022.9. Please use the QuestPDF.Settings.DocumentLayoutExceptionThreshold static property.")]
         [Obsolete("This API has been moved since version 2022.9. Please use the QuestPDF.Settings.DocumentLayoutExceptionThreshold static property.")]
+        [ExcludeFromCodeCoverage]
         public int DocumentLayoutExceptionThreshold
         public int DocumentLayoutExceptionThreshold
         {
         {
             get => Settings.DocumentLayoutExceptionThreshold;
             get => Settings.DocumentLayoutExceptionThreshold;
@@ -64,6 +66,7 @@ namespace QuestPDF.Infrastructure
         }
         }
 
 
         [Obsolete("This API has been moved since version 2022.9. Please use the QuestPDF.Settings.EnableCaching static property.")]
         [Obsolete("This API has been moved since version 2022.9. Please use the QuestPDF.Settings.EnableCaching static property.")]
+        [ExcludeFromCodeCoverage]
         public bool ApplyCaching
         public bool ApplyCaching
         {
         {
             get => Settings.EnableCaching;
             get => Settings.EnableCaching;
@@ -71,6 +74,7 @@ namespace QuestPDF.Infrastructure
         }
         }
         
         
         [Obsolete("This API has been moved since version 2022.9. Please use the QuestPDF.Settings.EnableDebugging static property.")]
         [Obsolete("This API has been moved since version 2022.9. Please use the QuestPDF.Settings.EnableDebugging static property.")]
+        [ExcludeFromCodeCoverage]
         public bool ApplyDebugging
         public bool ApplyDebugging
         {
         {
             get => Settings.EnableDebugging;
             get => Settings.EnableDebugging;
@@ -78,12 +82,15 @@ namespace QuestPDF.Infrastructure
         }
         }
         
         
         [Obsolete("This API has been moved since version 2023.5. Please use the QuestPDF.Infrastructure.DocumentSettings API.")]
         [Obsolete("This API has been moved since version 2023.5. Please use the QuestPDF.Infrastructure.DocumentSettings API.")]
+        [ExcludeFromCodeCoverage]
         public int? ImageQuality { get; set; }
         public int? ImageQuality { get; set; }
         
         
         [Obsolete("This API has been moved since version 2023.5. Please use the QuestPDF.Infrastructure.DocumentSettings API.")]
         [Obsolete("This API has been moved since version 2023.5. Please use the QuestPDF.Infrastructure.DocumentSettings API.")]
+        [ExcludeFromCodeCoverage]
         public int? RasterDpi { get; set; }
         public int? RasterDpi { get; set; }
         
         
         [Obsolete("This API has been moved since version 2023.5. Please use the QuestPDF.Infrastructure.DocumentSettings API.")]
         [Obsolete("This API has been moved since version 2023.5. Please use the QuestPDF.Infrastructure.DocumentSettings API.")]
+        [ExcludeFromCodeCoverage]
         public bool? PdfA { get; set; }
         public bool? PdfA { get; set; }
         
         
         #endregion
         #endregion