Skip to content

Commit 2f439ca

Browse files
yulian-gaponenkoitext-teamcity
authored andcommitted
Fix expected exception for FontProgramTest#exceptionMessageTest
Changes are caused by [279206fa18] "Get rid of the pre-check for the font file path" commit. Autoported commit. Original commit hash: [76b261370]
1 parent ca369cd commit 2f439ca

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

itext.tests/itext.io.tests/itext/io/font/FontProgramTest.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,16 @@ source product.
4545

4646
namespace iText.IO.Font {
4747
public class FontProgramTest {
48+
private const String notExistingFont = "some-font.ttf";
49+
4850
/// <exception cref="System.IO.IOException"/>
4951
[NUnit.Framework.Test]
5052
public virtual void ExceptionMessageTest() {
51-
String font = "some-font.ttf";
52-
try {
53-
FontProgramFactory.CreateFont(font);
54-
}
55-
catch (iText.IO.IOException ex) {
56-
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(iText.IO.IOException.FontFile1NotFound, font), ex
57-
.Message);
53+
NUnit.Framework.Assert.That(() => {
54+
FontProgramFactory.CreateFont(notExistingFont);
5855
}
56+
, NUnit.Framework.Throws.TypeOf<System.IO.IOException>().With.Message.EqualTo(MessageFormatUtil.Format("{0} not found as file or resource", notExistingFont)));
57+
;
5958
}
6059

6160
/// <exception cref="System.IO.IOException"/>

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e0f1a33df0bc5b2ac23be63c7e6ba334f5a8e859
1+
76b261370b3e1689f7a7ec4eba6025f42ccacf03

0 commit comments

Comments
 (0)