2018-01-11 03:49:32 +08:00
|
|
|
|
namespace UglyToad.PdfPig.Tests
|
2018-01-09 06:08:58 +08:00
|
|
|
|
{
|
|
|
|
|
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>
|
|
|
|
|
{
|
2018-01-11 03:49:32 +08:00
|
|
|
|
"UglyToad.PdfPig.PdfDocument",
|
|
|
|
|
"UglyToad.PdfPig.ParsingOptions",
|
|
|
|
|
"UglyToad.PdfPig.Logging.ILog",
|
|
|
|
|
"UglyToad.PdfPig.Geometry.PdfPoint",
|
2018-03-31 06:16:54 +08:00
|
|
|
|
"UglyToad.PdfPig.Geometry.PdfRectangle",
|
2018-01-11 03:49:32 +08:00
|
|
|
|
"UglyToad.PdfPig.Fonts.Exceptions.InvalidFontFormatException",
|
|
|
|
|
"UglyToad.PdfPig.Exceptions.PdfDocumentFormatException",
|
|
|
|
|
"UglyToad.PdfPig.Content.Letter",
|
|
|
|
|
"UglyToad.PdfPig.Content.Page",
|
|
|
|
|
"UglyToad.PdfPig.Content.PageSize",
|
|
|
|
|
"UglyToad.PdfPig.Content.DocumentInformation"
|
2018-01-09 06:08:58 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Assert.Equal(expected.OrderBy(x => x), publicTypeNames.OrderBy(x => x));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|