Skip to content

Commit 28c7c46

Browse files
V4.1 - Removed dependency on Eloquent library.
1 parent bff3967 commit 28c7c46

File tree

9 files changed

+12
-33
lines changed

9 files changed

+12
-33
lines changed

VERSION

0 Bytes
Binary file not shown.

src/TestDataGenerator.Core.Tests/TestDataGenerator.Core.Tests.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@
5757
<Prefer32Bit>false</Prefer32Bit>
5858
</PropertyGroup>
5959
<ItemGroup>
60-
<Reference Include="Eloquent, Version=1.0.1.1, Culture=neutral, processorArchitecture=MSIL">
61-
<SpecificVersion>False</SpecificVersion>
62-
<HintPath>..\packages\Eloquent.1.0.1.1\lib\net45\Eloquent.dll</HintPath>
63-
</Reference>
6460
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
6561
<Reference Include="System" />
6662
<Reference Include="System.Core">
@@ -94,7 +90,6 @@
9490
</BootstrapperPackage>
9591
</ItemGroup>
9692
<ItemGroup>
97-
<None Include="packages.config" />
9893
<None Include="tdg-patterns\invalid.tdg-patterns">
9994
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
10095
</None>

src/TestDataGenerator.Core.Tests/TextTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.IO;
66
using System.Linq;
77
using System.Text.RegularExpressions;
8-
using Eloquent;
98
using Microsoft.VisualStudio.TestTools.UnitTesting;
109
using TestDataGenerator.Core;
1110
using TestDataGenerator.Core.Exceptions;
@@ -1155,27 +1154,27 @@ public void Can_Generate_All_Symbols()
11551154

11561155
pattern = @"\s";
11571156
text = AlphaNumericGenerator.GenerateFromPattern(pattern);
1158-
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text.ToLiteral());
1157+
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text);
11591158
StringAssert.Matches(text, new Regex(@"^\s$"));
11601159

11611160
pattern = @"\t";
11621161
text = AlphaNumericGenerator.GenerateFromPattern(pattern);
1163-
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text.ToLiteral());
1162+
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text);
11641163
StringAssert.Matches(text, new Regex(@"^\t$"));
11651164

11661165
pattern = @"\n";
11671166
text = AlphaNumericGenerator.GenerateFromPattern(pattern);
1168-
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text.ToLiteral());
1167+
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text);
11691168
StringAssert.Matches(text, new Regex(@"^\n$"));
11701169

11711170
pattern = @"\r";
11721171
text = AlphaNumericGenerator.GenerateFromPattern(pattern);
1173-
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text.ToLiteral());
1172+
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text);
11741173
StringAssert.Matches(text, new Regex(@"^\r$"));
11751174

11761175
pattern = @"\\";
11771176
text = AlphaNumericGenerator.GenerateFromPattern(pattern);
1178-
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text.ToLiteral());
1177+
Console.WriteLine(@"'{0}' produced '{1}'", pattern, text);
11791178
StringAssert.Matches(text, new Regex(@"^\\$"));
11801179
}
11811180

src/TestDataGenerator.Core.Tests/packages.config

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

src/TestDataGenerator.Core.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
77
ProjectSection(SolutionItems) = preProject
88
DataGenerator.vsmdi = DataGenerator.vsmdi
99
LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
10+
Performance1.psess = Performance1.psess
11+
..\..\VERSION = ..\..\VERSION
1012
EndProjectSection
1113
EndProject
1214
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{3A492DFF-FDA0-4AC7-BD29-745203BDC70E}"

src/TestDataGenerator.Core/Generators/AlphaNumericGenerator.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Linq;
66
using System.Text;
77
using System.Text.RegularExpressions;
8-
using Eloquent;
98
using TestDataGenerator.Core.Exceptions;
109

1110
namespace TestDataGenerator.Core.Generators
@@ -265,7 +264,7 @@ public static string GenerateFromPattern(string pattern, Random random)
265264

266265
private static void InternalGenerateFromPattern(StringBuilder sb, string pattern, NamedPatterns namedPatterns, GenerationConfig config, Random random)
267266
{
268-
if (pattern == null || pattern.IsNullOrEmpty())
267+
if (pattern == null || string.IsNullOrEmpty(pattern))
269268
throw new GenerationException("Argument 'pattern' cannot be null.");
270269

271270
if (namedPatterns == null)
@@ -548,7 +547,7 @@ private static void AppendContentFromSetExpression(StringBuilder sb, string char
548547
{
549548
var possibles = contentOptions.Content;
550549
if (contentOptions.IsNegated)
551-
possibles = _ShortHands["."].RegexReplace("[" + possibles + "]", "");
550+
possibles = Regex.Replace(_ShortHands["."], "[" + possibles + "]", "");
552551

553552
for (int i = 0; i < contentOptions.Repeat; i++)
554553
{
@@ -589,7 +588,7 @@ private static string GetRandomAlphaItemFromRange(bool isNegated, Random random,
589588
{
590589
var end = possibles.IndexOf(items[1].ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal);
591590
possibles = possibles.Substring(start, end - start + 1);
592-
if (isNegated) possibles = _ShortHands["."].RegexReplace("[" + possibles + "]", "");
591+
if (isNegated) possibles = Regex.Replace(_ShortHands["."],"[" + possibles + "]", "");
593592
ret = possibles[random.Next(0, possibles.Length)].ToString(CultureInfo.InvariantCulture);
594593
}
595594
return ret;
@@ -615,7 +614,7 @@ private static string GetRandomNumericItemFromRange(bool isNegated, Random rando
615614
throw new GenerationException("Negated numeric sets are restricted to integers between 1 and 9.");
616615

617616
var negs = ExpandNegatedMinMax(min, max);
618-
possibles = possibles.RegexReplace("[" + negs + "]", "");
617+
possibles = Regex.Replace(possibles, "[" + negs + "]", "");
619618
if (possibles.Length == 0) return ""; // No allowable values remain - return empty string
620619
ret = possibles[random.Next(0, possibles.Length)].ToString(CultureInfo.InvariantCulture);
621620
}

src/TestDataGenerator.Core/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("4.0.3")]
34+
[assembly: AssemblyVersion("4.1.0")]

src/TestDataGenerator.Core/TestDataGenerator.Core.csproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,10 @@
5656
<Prefer32Bit>false</Prefer32Bit>
5757
</PropertyGroup>
5858
<ItemGroup>
59-
<Reference Include="Eloquent, Version=1.0.1.1, Culture=neutral, processorArchitecture=MSIL">
60-
<SpecificVersion>False</SpecificVersion>
61-
<HintPath>..\packages\Eloquent.1.0.1.1\lib\net45\Eloquent.dll</HintPath>
62-
</Reference>
6359
<Reference Include="System" />
6460
<Reference Include="System.Core">
6561
<RequiredTargetFramework>3.5</RequiredTargetFramework>
6662
</Reference>
67-
<Reference Include="System.Data" />
6863
<Reference Include="System.Runtime.Serialization" />
6964
<Reference Include="System.Xml" />
7065
</ItemGroup>
@@ -101,9 +96,6 @@
10196
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
10297
</EmbeddedResource>
10398
</ItemGroup>
104-
<ItemGroup>
105-
<None Include="packages.config" />
106-
</ItemGroup>
10799
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
108100
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
109101
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

src/TestDataGenerator.Core/packages.config

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

0 commit comments

Comments
 (0)