Skip to content

Commit 366bdcf

Browse files
committed
moved domain like class to /Domain for the yaml tests generation
1 parent 21f8149 commit 366bdcf

19 files changed

+93
-2497
lines changed

src/CodeGeneration.LowLevelClient/CodeGeneration.LowLevelClient.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@
9494
<None Include="Views\QueryStringParameters.Generated.cshtml" />
9595
<None Include="Views\IRawElasticClient.Generated.cshtml" />
9696
</ItemGroup>
97-
<ItemGroup>
98-
<Content Include="razormachine.readme.txt" />
99-
</ItemGroup>
10097
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
10198
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
10299
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

src/CodeGeneration.LowLevelClient/razormachine.readme.txt

-20
This file was deleted.

src/CodeGeneration.YamlTestsRunner/CodeGeneration.YamlTestsRunner.csproj

+12-10
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,22 @@
6969
</Reference>
7070
</ItemGroup>
7171
<ItemGroup>
72+
<Compile Include="Domain\GreaterThanStep.cs" />
73+
<Compile Include="Domain\IsFalseStep.cs" />
74+
<Compile Include="Domain\IsTrueStep.cs" />
75+
<Compile Include="Domain\LengthStep.cs" />
76+
<Compile Include="Domain\LowerThanStep.cs" />
77+
<Compile Include="Domain\MatchStep.cs" />
78+
<Compile Include="Domain\SkipStep.cs" />
7279
<Compile Include="Domain\YamlDefinition.cs" />
7380
<Compile Include="Domain\YamlSpecification.cs" />
74-
<Compile Include="DoStep.cs" />
81+
<Compile Include="Domain\DoStep.cs" />
7582
<Compile Include="Extensions.cs" />
76-
<Compile Include="ITestStep.cs" />
83+
<Compile Include="Domain\ITestStep.cs" />
7784
<Compile Include="Program.cs" />
7885
<Compile Include="Properties\AssemblyInfo.cs" />
79-
<Compile Include="SetStep.cs" />
80-
<Compile Include="TestSuite.cs" />
86+
<Compile Include="Domain\SetStep.cs" />
87+
<Compile Include="Domain\TestSuite.cs" />
8188
<Compile Include="YamlTestsGenerator.cs" />
8289
</ItemGroup>
8390
<ItemGroup>
@@ -96,12 +103,7 @@
96103
<None Include="Views\SetupClass.cshtml" />
97104
<None Include="Views\TestSuite.cshtml" />
98105
</ItemGroup>
99-
<ItemGroup>
100-
<Content Include="razormachine.readme.txt" />
101-
</ItemGroup>
102-
<ItemGroup>
103-
<Folder Include="Converters\" />
104-
</ItemGroup>
106+
<ItemGroup />
105107
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
106108
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
107109
Other similar extension points exist, see Microsoft.Common.targets.

src/CodeGeneration.YamlTestsRunner/DoStep.cs renamed to src/CodeGeneration.YamlTestsRunner/Domain/DoStep.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
using System.Collections.Generic;
2-
using System.Collections.Specialized;
3-
using System.IO;
42
using System.Linq;
53
using System.Text.RegularExpressions;
6-
using Microsoft.SqlServer.Server;
7-
using Newtonsoft.Json;
84
using YamlDotNet.Dynamic;
95

10-
namespace CodeGeneration.YamlTestsRunner
6+
namespace CodeGeneration.YamlTestsRunner.Domain
117
{
128
public class DoStep : ITestStep
139
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace CodeGeneration.YamlTestsRunner.Domain
2+
{
3+
public class GreaterThanStep : ITestStep
4+
{
5+
public string Type { get { return "gt"; }}
6+
7+
public int Value { get; set; }
8+
public string ResponseValue { get; set; }
9+
}
10+
}

src/CodeGeneration.YamlTestsRunner/ITestStep.cs renamed to src/CodeGeneration.YamlTestsRunner/Domain/ITestStep.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CodeGeneration.YamlTestsRunner
1+
namespace CodeGeneration.YamlTestsRunner.Domain
22
{
33
public interface ITestStep
44
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace CodeGeneration.YamlTestsRunner.Domain
2+
{
3+
public class IsFalseStep : ITestStep
4+
{
5+
public string Type { get { return "is_false"; } }
6+
public string ResponseValue { get; set; }
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace CodeGeneration.YamlTestsRunner.Domain
2+
{
3+
public class IsTrueStep : ITestStep
4+
{
5+
public string Type { get { return "is_true"; } }
6+
public string ResponseValue { get; set; }
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace CodeGeneration.YamlTestsRunner.Domain
2+
{
3+
public class LengthStep : ITestStep
4+
{
5+
public string Type { get { return "length"; }}
6+
7+
public int Value { get; set; }
8+
public string ResponseValue { get; set; }
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace CodeGeneration.YamlTestsRunner.Domain
2+
{
3+
public class LowerThanStep : ITestStep
4+
{
5+
public string Type { get { return "lt"; }}
6+
7+
public int Value { get; set; }
8+
public string ResponseValue { get; set; }
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace CodeGeneration.YamlTestsRunner.Domain
2+
{
3+
public class MatchStep : ITestStep
4+
{
5+
public string Type { get { return "match"; }}
6+
7+
public string RawValue { get; set; }
8+
public string ResponseValue { get; set; }
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace CodeGeneration.YamlTestsRunner.Domain
2+
{
3+
public class SetStep : ITestStep
4+
{
5+
public string Type { get { return "set"; }}
6+
7+
public string VariableName { get; set; }
8+
public string ResponseValue { get; set; }
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace CodeGeneration.YamlTestsRunner.Domain
2+
{
3+
public class SkipStep : ITestStep
4+
{
5+
public string Type { get { return "skip"; }}
6+
7+
public string Version { get; set; }
8+
public string Reason { get; set; }
9+
}
10+
}

src/CodeGeneration.YamlTestsRunner/TestSuite.cs renamed to src/CodeGeneration.YamlTestsRunner/Domain/TestSuite.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@
55
using System.Text.RegularExpressions;
66
using CsQuery.ExtensionMethods.Internal;
77

8-
namespace CodeGeneration.YamlTestsRunner
8+
namespace CodeGeneration.YamlTestsRunner.Domain
99
{
10-
using YamlTestSuite = Dictionary<string, object>;
11-
1210
public class TestSuite
1311
{
1412
public string Description { get; set; }
1513
public IEnumerable<ITestStep> Steps { get; set; }
1614
public bool HasSetup { get; set; }
1715
public bool IsSetup { get; set; }
1816

19-
public static TestSuite CreateFrom(YamlTestSuite untyped, string yaml)
17+
public static TestSuite CreateFrom(Dictionary<string, object> untyped, string yaml)
2018
{
2119
if (untyped == null || untyped.Count == 0)
2220
return null;

src/CodeGeneration.YamlTestsRunner/SetStep.cs

-57
This file was deleted.

src/CodeGeneration.YamlTestsRunner/YamlTestsGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private static void PatchDefinition(YamlDefinition yamlDefinition, string folder
140140
private static IEnumerable<TestSuite> ParseYaml(string yaml)
141141
{
142142
var deserializer = new Deserializer();
143-
var tests = Regex.Split(yaml, @"---\n");
143+
var tests = Regex.Split(yaml, @"---\r?\n");
144144
var r = new List<TestSuite>();
145145
foreach (var test in tests.Where(t=>!t.IsNullOrEmpty()))
146146
{

src/CodeGeneration.YamlTestsRunner/razormachine.readme.txt

-20
This file was deleted.

0 commit comments

Comments
 (0)