Debian Codegraph @

contrib/C#/NGraphiteTests/GeneralTests.cs

raw
1 // SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later
2 // Copyright (C) 2012 SIL International
3 using NUnit.Framework;
4 using NGraphite;
5 using System.Collections.Generic;
6
7 namespace NGraphiteTests
8 {
9 [TestFixture()]
10 public class GeneralTests
11 {
12 [Test()]
13 public void EnumerateAllFeaturesInAFont()
14 {
15 var idDescDictionary = new Dictionary<string, string>();
16
17 using (var face = new Face(TestConstants.PaduakFontLocation, FaceOptions.face_default))
18 {
19 for(int i = 0; i < face.NFref(); i++)
20 {
21 var featureRef = face.Fref((ushort)i);
22 var refLabel = featureRef.Label("en", Encform.Utf16);
23
24 idDescDictionary.Add(featureRef.IdLabel, refLabel);
25 }
26 }
27
28 string val;
29 idDescDictionary.TryGetValue("kdot", out val);
30 Assert.AreEqual("Khamti style dots", val);
31
32 idDescDictionary.TryGetValue("nnya", out val);
33 Assert.AreEqual("Disable great nnya", val);
34
35 }
36 }
37 }
38