Skip to content

Commit 3280e9d

Browse files
committed
Update Tokenize test to assert handling of unknown characters as TokenType.Unknown.
1 parent b6bcf38 commit 3280e9d

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎tests/L5Sharp.Tests.Core/Common/NeutralTextTests.cs‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,15 @@ public void Tokenize_UnrecognizedCharacters_ShouldNotThrow()
371371
}
372372

373373
[Test]
374-
public void Tokenize_UnexpectedCharacter_ShouldThrowArgumentException()
374+
public void Tokenize_UnexpectedCharacter_ShouldBeUnknown()
375375
{
376-
var text = new NeutralText("MyTag #"); // # alone is not valid at start of token
377-
378-
// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
379-
Action act = () => text.Tokenize().ToList();
376+
var text = new NeutralText("MyTag #");
377+
378+
var tokens = text.Tokenize().ToList();
380379

381-
act.Should().Throw<ArgumentException>().WithMessage("*Unexpected character '#'*");
380+
tokens.Should().HaveCount(3);
381+
tokens[1].Value.Should().Be("#");
382+
tokens[1].Type.Should().Be(TokenType.Unknown);
382383
}
383384

384385
[Test]

0 commit comments

Comments
 (0)