Skip to content

Commit bff3967

Browse files
v4.0.3
1 parent 2f97a32 commit bff3967

File tree

5 files changed

+159
-124
lines changed

5 files changed

+159
-124
lines changed

CHANGELOG.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

VERSION

0 Bytes
Binary file not shown.

src/TestDataGenerator.Core.Tests/TextTests.cs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,62 @@ public void Can_Generate_Range_Repeated_Set4()
401401
StringAssert.Matches(text, new Regex(@"^[W-X]$"));
402402
}
403403

404+
[TestMethod]
405+
[TestCategory("Sets")]
406+
public void Can_Generate_Section_Repeated_Escape_Chars()
407+
{
408+
// empty repeat expressions should result in a single instance - {} == {1}
409+
var template = @"(\\){10}";
410+
string text = AlphaNumericGenerator.GenerateFromPattern(template);
411+
Console.WriteLine(@"'{0}' produced '{1}'", template, text);
412+
StringAssert.Matches(text, new Regex(template));
413+
}
414+
415+
[TestMethod]
416+
[TestCategory("Sets")]
417+
public void Can_Generate_Repeated_Escape_Chars()
418+
{
419+
// empty repeat expressions should result in a single instance - {} == {1}
420+
var template = @"\\{10}";
421+
string text = AlphaNumericGenerator.GenerateFromPattern(template);
422+
Console.WriteLine(@"'{0}' produced '{1}'", template, text);
423+
StringAssert.Matches(text, new Regex(template));
424+
}
425+
426+
[TestMethod]
427+
[TestCategory("Sets")]
428+
public void Can_Generate_Range_Repeated_Chars()
429+
{
430+
// empty repeat expressions should result in a single instance - {} == {1}
431+
var template = @"(a){10}";
432+
string text = AlphaNumericGenerator.GenerateFromPattern(template);
433+
Console.WriteLine(@"'{0}' produced '{1}'", template, text);
434+
StringAssert.Matches(@"aaaaaaaaaa", new Regex(template));
435+
}
436+
437+
438+
[TestMethod]
439+
[TestCategory("Sets")]
440+
public void Can_Generate_Negated_Range()
441+
{
442+
// empty repeat expressions should result in a single instance - {} == {1}
443+
var template = @"[^5-9]";
444+
string text = AlphaNumericGenerator.GenerateFromPattern(template);
445+
Console.WriteLine(@"'{0}' produced '{1}'", template, text);
446+
StringAssert.Matches(text, new Regex(template));
447+
}
448+
449+
[TestMethod]
450+
[TestCategory("Sets")]
451+
public void Can_Generate_Negated_Range_And_Characters()
452+
{
453+
// empty repeat expressions should result in a single instance - {} == {1}
454+
var template = @"[^A-Z5-9!£$%^&*()_+]";
455+
string text = AlphaNumericGenerator.GenerateFromPattern(template);
456+
Console.WriteLine(@"'{0}' produced '{1}'", template, text);
457+
StringAssert.Matches(text, new Regex(template));
458+
}
459+
404460

405461
[TestMethod]
406462
[TestCategory("Sets")]
@@ -1547,6 +1603,7 @@ public void Can_Configure_And_Produce_Output_With_Seed2()
15471603
Console.WriteLine(@"'{0}' produced '{1}'", template, text);
15481604

15491605
Assert.AreEqual(text, @"Generated |k*XjUo6Eo ");
1606+
//Assert.AreEqual(text, @"Generated |k)XjUo6Eo ");
15501607
}
15511608

15521609
[TestMethod]

0 commit comments

Comments
 (0)