Skip to content

Commit

Permalink
moved code to a single project
Browse files Browse the repository at this point in the history
  • Loading branch information
gicastel committed Oct 5, 2022
1 parent 3e9b511 commit d3b0142
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 56 deletions.
15 changes: 0 additions & 15 deletions src/TestBase/TestBase.csproj

This file was deleted.

20 changes: 7 additions & 13 deletions src/qest.sln
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBase", "TestBase\TestBase.csproj", "{B6FF040E-083C-472A-A76E-E4F439241D0A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "qest", "qest\qest.csproj", "{64110F91-7843-4F56-9B16-6F79FEFD2B39}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "qest", "qest\qest.csproj", "{79EF488B-B5FE-4DEE-807E-51CA359318C9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B6FF040E-083C-472A-A76E-E4F439241D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6FF040E-083C-472A-A76E-E4F439241D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6FF040E-083C-472A-A76E-E4F439241D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6FF040E-083C-472A-A76E-E4F439241D0A}.Release|Any CPU.Build.0 = Release|Any CPU
{64110F91-7843-4F56-9B16-6F79FEFD2B39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64110F91-7843-4F56-9B16-6F79FEFD2B39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64110F91-7843-4F56-9B16-6F79FEFD2B39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64110F91-7843-4F56-9B16-6F79FEFD2B39}.Release|Any CPU.Build.0 = Release|Any CPU
{79EF488B-B5FE-4DEE-807E-51CA359318C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79EF488B-B5FE-4DEE-807E-51CA359318C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79EF488B-B5FE-4DEE-807E-51CA359318C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79EF488B-B5FE-4DEE-807E-51CA359318C9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {79F02C7F-71C9-4BA8-8776-A90C9E1764BB}
SolutionGuid = {012C640D-552E-4C1F-9A71-B754DB10D79C}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions src/qest/Commands/GenerateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using TestBase;
using qest.Models;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;

Expand Down Expand Up @@ -33,7 +33,7 @@ ORDER BY
internal const string yamlSchema =
@"# yaml-language-server: $schema=https://raw.githubusercontent.com/Geims83/qest/0.9.2/docs/yamlSchema.json";

internal static async Task Run(DirectoryInfo? folder, string tcs)
internal static async Task Execute(DirectoryInfo? folder, string tcs)
{
var sqlConnection = new SqlConnection(tcs);

Expand Down
7 changes: 4 additions & 3 deletions src/qest/Commands/RunCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using TestBase;
using qest.Models;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;

namespace qest.Commands
{
internal static class RunTests
internal static class Run
{
internal static void Run(FileInfo? file, DirectoryInfo? folder, string tcs)

internal static void Execute(FileInfo? file, DirectoryInfo? folder, string tcs)
{
List<Test> TestCollection = new List<Test>();

Expand Down
2 changes: 1 addition & 1 deletion src/TestBase/Assert.cs → src/qest/Models/Assert.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Data;

namespace TestBase
namespace qest.Models
{
public class Assert
{
Expand Down
6 changes: 5 additions & 1 deletion src/TestBase/Script.cs → src/qest/Models/Script.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace TestBase
using System;
using System.Collections.Generic;
using System.IO;

namespace qest.Models
{
public class Script
{
Expand Down
3 changes: 2 additions & 1 deletion src/TestBase/Scripts.cs → src/qest/Models/Scripts.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Data.SqlClient;

namespace TestBase
namespace qest.Models
{
public class Scripts : List<Script>
{
Expand Down
7 changes: 5 additions & 2 deletions src/TestBase/Test.cs → src/qest/Models/Test.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using System.Data;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using YamlDotNet.Serialization;

namespace TestBase
namespace qest.Models
{
public class Test
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Data;
using System.Collections.Generic;

namespace TestBase
namespace qest.Models
{
public class TestCommand
{
Expand Down
5 changes: 3 additions & 2 deletions src/TestBase/TestResult.cs → src/qest/Models/TestResult.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Data;
using System.Collections.Generic;
using System.Data;

namespace TestBase
namespace qest.Models
{

public class ResultGroup
Expand Down
4 changes: 3 additions & 1 deletion src/TestBase/TestStep.cs → src/qest/Models/TestStep.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TestBase
using System.Collections.Generic;

namespace qest.Models
{
public class TestStep
{
Expand Down
4 changes: 2 additions & 2 deletions src/qest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal static Command CreateRunCommand()

runCommand.SetHandler((file, folder, tcs) =>
{
RunTests.Run(file, folder, tcs);
Run.Execute(file, folder, tcs);
},
file, folder, tcs);

Expand All @@ -51,7 +51,7 @@ internal static Command CreateGenerateCommand()

generateCommand.SetHandler(async(folder, tcs) =>
{
await Generate.Run(folder, tcs);
await Generate.Execute(folder, tcs);
},
folder, tcs);

Expand Down
15 changes: 9 additions & 6 deletions src/TestBase/Utils.cs → src/qest/Utils/Utils.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System.Data;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;

namespace TestBase
namespace qest
{
internal static class Utils
{
Expand All @@ -9,7 +12,7 @@ internal static class Utils
SqlDbType.Bit => typeof(bool),
SqlDbType.TinyInt => typeof(byte),
SqlDbType.SmallInt => typeof(short),
SqlDbType.BigInt => typeof(Int64),
SqlDbType.BigInt => typeof(long),
SqlDbType.Float => typeof(double),
SqlDbType.Int => typeof(int),
SqlDbType.NVarChar => typeof(string),
Expand All @@ -18,9 +21,9 @@ internal static class Utils
SqlDbType.Date => typeof(DateTime),
SqlDbType.DateTimeOffset => typeof(DateTimeOffset),
SqlDbType.Time => typeof(TimeSpan),
SqlDbType.Real => typeof(Single),
SqlDbType.Decimal => typeof(Decimal),
SqlDbType.Money => typeof(Decimal),
SqlDbType.Real => typeof(float),
SqlDbType.Decimal => typeof(decimal),
SqlDbType.Money => typeof(decimal),

_ => throw new ArgumentOutOfRangeException(nameof(type), $"Type not expected: {type}"),
};
Expand Down
7 changes: 2 additions & 5 deletions src/qest/qest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="YamlDotNet" Version="12.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Include="YamlDotNet" Version="12.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TestBase\TestBase.csproj" />
</ItemGroup>

</Project>

0 comments on commit d3b0142

Please sign in to comment.