Skip to content

Commit

Permalink
Merge pull request #17 from fdonnet/xUnit-stepcore1
Browse files Browse the repository at this point in the history
Very first step in unit testing.
PR to put the base in place with xUnit
  • Loading branch information
fdonnet authored Dec 1, 2022
2 parents 7f34209 + fa43e11 commit e08c2d8
Show file tree
Hide file tree
Showing 64 changed files with 1,572 additions and 458 deletions.
1 change: 0 additions & 1 deletion .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: build and test

on:
push:
pull_request:
branches: [ main ]
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Dapper_Layers_Generator.Data.POCO;
using Spectre.Console;
using System.Text.Json;
using Table = Dapper_Layers_Generator.Data.POCO.Table;

internal partial class ConsoleService
{
Expand All @@ -16,7 +17,7 @@ internal async Task ShowAdvancedAsync()
var settings = _generatorService.GlobalGeneratorSettings;

var selectedTables = _dataService.SchemaDefinitions?.FirstOrDefault(s => s.Name ==
settings.SelectedSchema)?.Tables ?? new List<ITable>();
settings.SelectedSchema)?.Tables ?? new List<Table>();

//Exclude if not selected for generation
if (!settings.RunGeneratorForAllTables)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
using Dapper_Layers_Generator.Core.Settings;
using Dapper_Layers_Generator.Data.POCO;
using Spectre.Console;
using Table = Dapper_Layers_Generator.Data.POCO.Table;

internal partial class ConsoleService
{
internal async Task ShowSelectTablesAsync()
{
AnsiConsole.Clear();
var settings = _generatorService.GlobalGeneratorSettings;

var tables = _dataService.SchemaDefinitions?.FirstOrDefault(s => s.Name == settings.SelectedSchema)?.Tables ?? new List<ITable>();
var tables = _dataService.SchemaDefinitions?.FirstOrDefault(s => s.Name == settings.SelectedSchema)?.Tables ?? new List<Table>();

if (settings.RunGeneratorForAllTables)
{
Expand All @@ -24,7 +26,7 @@ Continue like this (y) or select tables(n):"))
}
else
{
var tableUI = new Table();
var tableUI = new Spectre.Console.Table();
tableUI.AddColumn("Table name");
tableUI.AddColumn("Selected");

Expand Down Expand Up @@ -60,7 +62,7 @@ Continue like this (y) or select tables(n):"))
}
}

private static List<string> BuildSelectionTable(SettingsGlobal settings, IList<ITable> tables)
private static List<string> BuildSelectionTable(SettingsGlobal settings, IList<Dapper_Layers_Generator.Data.POCO.Table> tables)
{
if (tables != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Spectre.Console;
using System.Reflection;

ServiceProvider? _builder = null;
string? _dbProviderToReadDBDef = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
using Dapper_Layers_Generator.Core.Generators.MySql;
using Dapper_Layers_Generator.Core.Settings;
using Microsoft.Extensions.DependencyInjection;
using MySqlX.XDevAPI.Relational;
using System;
using System.ComponentModel.Design.Serialization;
using System.Data;
using System.Reflection.Metadata.Ecma335;
using System.Text;

namespace Dapper_Layers_Generator.Core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Dapper_Layers_Generator.Core.Converters;
using Dapper_Layers_Generator.Core.Settings;
using Dapper_Layers_Generator.Data.POCO;
using System.Reflection.Metadata.Ecma335;

namespace Dapper_Layers_Generator.Core.Generators
{
Expand All @@ -14,7 +13,7 @@ public interface IGenerator
public abstract class Generator : IGenerator
{
protected readonly SettingsGlobal _settings;
protected readonly ISchema _currentSchema;
protected readonly Schema _currentSchema;
protected readonly StringTransformationService _stringTransform;
private readonly IReaderDBDefinitionService _data;
#pragma warning disable IDE1006 // Naming Styles
Expand Down
Loading

0 comments on commit e08c2d8

Please sign in to comment.