fix(core): Fixes string wrapping for houses (#717)

This commit is contained in:
Kamron Batman 2021-08-22 10:01:01 -07:00 committed by GitHub
parent d9a9e90c14
commit 3b44ee0c6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 6 deletions

View file

@ -45,10 +45,18 @@ namespace Server.Tests
[InlineData("this is a sentence that will probably wrap around a few times because it is long", 10, 6)]
[InlineData("An Unnamed House", 10, 6)]
[InlineData("Batville", 10, 6)]
public void TestWrap(string sentence, int perLine, int maxLines)
[InlineData("Bald's Shop", 10, 6)]
[InlineData(
"Something ThatIsVeryLongAndShouldBe broken up",
10, 6,
"Something", "ThatIsVery", "LongAndSho", "uldBe", "broken up"
)]
public void TestWrap(string sentence, int perLine, int maxLines, params string[] customExpected)
{
var expected = OldWrap(sentence, perLine, maxLines);
var actual = sentence.Wrap(perLine, maxLines);
var expected = customExpected.Length > 0
? customExpected
: OldWrap(sentence, perLine, maxLines).ToArray();
var actual = sentence.Wrap(perLine, maxLines).ToArray();
Assert.Equal(expected, actual);
}