mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 02:44:58 +08:00
more tests for glyphlist
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
namespace UglyToad.PdfPig.Tests.Fonts.Encodings
|
namespace UglyToad.PdfPig.Tests.Fonts.Encodings
|
||||||
{
|
{
|
||||||
|
using System.Collections.Generic;
|
||||||
using PdfPig.Fonts.Encodings;
|
using PdfPig.Fonts.Encodings;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
@@ -32,5 +33,38 @@
|
|||||||
|
|
||||||
Assert.Equal("O", result);
|
Assert.Equal("O", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void UnicodeToNameNotDefined()
|
||||||
|
{
|
||||||
|
var list = new GlyphList(new Dictionary<string, string>());
|
||||||
|
|
||||||
|
var result = list.UnicodeCodePointToName(120);
|
||||||
|
|
||||||
|
Assert.Equal(".notdef", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void NameToUnicodeNull()
|
||||||
|
{
|
||||||
|
var list = new GlyphList(new Dictionary<string, string>());
|
||||||
|
|
||||||
|
var result = list.NameToUnicode(null);
|
||||||
|
|
||||||
|
Assert.Null(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void NameToUnicodeRemovesSuffix()
|
||||||
|
{
|
||||||
|
var list = new GlyphList(new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{"Boris", "B"}
|
||||||
|
});
|
||||||
|
|
||||||
|
var result = list.NameToUnicode("Boris.Special");
|
||||||
|
|
||||||
|
Assert.Equal("B", result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user