mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 19:05:01 +08:00
check public api through reflection
This commit is contained in:
43
src/UglyToad.Pdf.Tests/PublicApiScannerTests.cs
Normal file
43
src/UglyToad.Pdf.Tests/PublicApiScannerTests.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
namespace UglyToad.Pdf.Tests
|
||||||
|
{
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
public class PublicApiScannerTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void OnlyExposedApiIsPublic()
|
||||||
|
{
|
||||||
|
var assembly = typeof(PdfDocument).Assembly;
|
||||||
|
|
||||||
|
var types = assembly.GetTypes();
|
||||||
|
|
||||||
|
var publicTypeNames = new List<string>();
|
||||||
|
|
||||||
|
foreach (var type in types)
|
||||||
|
{
|
||||||
|
if (type.IsPublic)
|
||||||
|
{
|
||||||
|
publicTypeNames.Add(type.FullName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var expected = new List<string>
|
||||||
|
{
|
||||||
|
"UglyToad.Pdf.PdfDocument",
|
||||||
|
"UglyToad.Pdf.ParsingOptions",
|
||||||
|
"UglyToad.Pdf.Logging.ILog",
|
||||||
|
"UglyToad.Pdf.Geometry.PdfPoint",
|
||||||
|
"UglyToad.Pdf.Fonts.Exceptions.InvalidFontFormatException",
|
||||||
|
"UglyToad.Pdf.Exceptions.PdfDocumentFormatException",
|
||||||
|
"UglyToad.Pdf.Content.Letter",
|
||||||
|
"UglyToad.Pdf.Content.Page",
|
||||||
|
"UglyToad.Pdf.Content.PageSize",
|
||||||
|
"UglyToad.Pdf.Content.DocumentInformation"
|
||||||
|
};
|
||||||
|
|
||||||
|
Assert.Equal(expected.OrderBy(x => x), publicTypeNames.OrderBy(x => x));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
7
src/UglyToad.Pdf/Filters/IPngPredictor.cs
Normal file
7
src/UglyToad.Pdf/Filters/IPngPredictor.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace UglyToad.Pdf.Filters
|
||||||
|
{
|
||||||
|
internal interface IPngPredictor
|
||||||
|
{
|
||||||
|
byte[] Decode(byte[] input, int predictor, int colors, int bitsPerComponent, int columns);
|
||||||
|
}
|
||||||
|
}
|
@@ -231,9 +231,4 @@
|
|||||||
return (by & mask) | (truncatedVal << startBit);
|
return (by & mask) | (truncatedVal << startBit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IPngPredictor
|
|
||||||
{
|
|
||||||
byte[] Decode(byte[] input, int predictor, int colors, int bitsPerComponent, int columns);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* @author John Hewson
|
* @author John Hewson
|
||||||
*/
|
*/
|
||||||
public class Hex
|
internal class Hex
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* for hex conversion.
|
* for hex conversion.
|
||||||
|
Reference in New Issue
Block a user