Skip to content

Commit 7a46941

Browse files
SnipxiText-CI
authored andcommitted
Avoid using Assert.assertSame for enums and primitive types
There is a difference in how Java and .NET implement this assertion and it does not make a lot of sense for primitives or enums anyway DEVSIX-3585 Autoported commit. Original commit hash: [9373d7a09]
1 parent d263959 commit 7a46941

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

itext.tests/itext.kernel.tests/itext/kernel/pdf/PdfTokenizerTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,17 @@ public virtual void PrimitivesTest() {
216216
NUnit.Framework.Assert.AreEqual(tok.GetTokenType(), PdfTokenizer.TokenType.StartArray);
217217
tok.NextValidToken();
218218
NUnit.Framework.Assert.AreEqual(tok.GetTokenType(), PdfTokenizer.TokenType.String);
219-
NUnit.Framework.Assert.AreEqual(tok.IsHexString(), true);
219+
NUnit.Framework.Assert.IsTrue(tok.IsHexString());
220220
PdfString str = new PdfString(tok.GetByteContent(), tok.IsHexString());
221221
NUnit.Framework.Assert.AreEqual("some hex string ", str.GetValue());
222222
tok.NextValidToken();
223223
NUnit.Framework.Assert.AreEqual(tok.GetTokenType(), PdfTokenizer.TokenType.String);
224-
NUnit.Framework.Assert.AreEqual(tok.IsHexString(), false);
224+
NUnit.Framework.Assert.IsFalse(tok.IsHexString());
225225
str = new PdfString(tok.GetByteContent(), tok.IsHexString());
226226
NUnit.Framework.Assert.AreEqual("some simple string ", str.GetValue());
227227
tok.NextValidToken();
228228
NUnit.Framework.Assert.AreEqual(tok.GetTokenType(), PdfTokenizer.TokenType.String);
229-
NUnit.Framework.Assert.AreEqual(tok.IsHexString(), true);
229+
NUnit.Framework.Assert.IsTrue(tok.IsHexString());
230230
str = new PdfString(tok.GetByteContent(), tok.IsHexString());
231231
NUnit.Framework.Assert.AreEqual("\u008C%G\u00D5\u008DK\u00D2\u00C6\u00F3\u00D3+\u0083\u000B\u00E3%\u009D "
232232
, str.GetValue());

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c262a8c31c7bf350c67195662137804dddbf5bb8
1+
9373d7a094dbea20c5af5b765951ab6f9217a49b

0 commit comments

Comments
 (0)