Skip to content

Commit 1412d81

Browse files
committed
#774 Testing
1 parent 5e55185 commit 1412d81

File tree

25 files changed

+220
-412
lines changed

25 files changed

+220
-412
lines changed

Generator.Tests.Integration/SingleDatabaseTestBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Diagnostics;
44
using System.IO;
5+
using System.Linq;
56
using Efrpg;
67
using Efrpg.FileManagement;
78
using Efrpg.Filtering;
@@ -118,7 +119,7 @@ protected static void CompareAgainstFolderTestComparison(string subFolder)
118119

119120
Assert.AreEqual(testComparisonFiles.Length, generatedFiles.Length);
120121

121-
foreach (var comparisonFile in testComparisonFiles)
122+
foreach (var comparisonFile in testComparisonFiles.Where(x => x.ToLower().EndsWith("Audit")))
122123
{
123124
var filename = Path.GetFileName(comparisonFile);
124125
var generatedPath = Path.Combine(Settings.Root, filename);

Generator.Tests.Integration/SingleDatabaseTestSqlCeServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void ReverseEngineerSqlCe_EfCore(bool separateFiles, TemplateType templat
6666

6767
// Act
6868
var filename = "Northwind";
69-
var subFolder = templateType == TemplateType.EfCore2 ? "TestComparison\\EfCore2NorthwindSqlCe40" : "TestComparison\\EfCore3NorthwindSqlCe40";
69+
var subFolder = $"TestComparison\\{templateType}NorthwindSqlCe40";
7070
Run(filename, ".SqlCE", typeof(EfCoreFileManager), subFolder);
7171

7272
// Assert

Generator.Tests.Integration/TestComparison/EfrpgTestIncludeFilter_SqlServer_EfCore3_FkLegacy.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ public interface IEfrpgDbContext : IDisposable
186186
List<TestReturnStringReturnModel> TestReturnString(out int procResult);
187187
Task<List<TestReturnStringReturnModel>> TestReturnStringAsync();
188188

189+
int ThisHasMixedOutParameters(DateTime? foo, out int? firstOutParam, DateTime? bar, out int? secondOutParam, DateTime? baz);
190+
// ThisHasMixedOutParametersAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)
191+
189192
int UserDefinedTypeSampleStoredProc(int? a, DataTable type, int? b);
190193
// UserDefinedTypeSampleStoredProcAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)
191194

Generator.Tests.Integration/TestComparison/Northwind_PostgreSQL_EfCore3_FkLegacy.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public int CustOrderHist(string x)
246246

247247
// CustOrderHistAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)
248248

249-
public int CustOrdersDetail(int? p1)
249+
public int CustOrdersDetail(int? p1 = null)
250250
{
251251
var p1Param = new NpgsqlParameter { ParameterName = "p1", SqlDbType = SqlDbType.integer, Direction = ParameterDirection.Input, Value = p1.GetValueOrDefault() };
252252
if (!p1.HasValue)
@@ -276,7 +276,7 @@ public int CustOrdersOrders(string p1)
276276

277277
// CustOrdersOrdersAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)
278278

279-
public int EmployeeSalesByCountry(DateTime? p1, DateTime? p2)
279+
public int EmployeeSalesByCountry(DateTime? p1 = null, DateTime? p2 = null)
280280
{
281281
var p1Param = new NpgsqlParameter { ParameterName = "p1", SqlDbType = SqlDbType.date, Direction = ParameterDirection.Input, Value = p1.GetValueOrDefault() };
282282
if (!p1.HasValue)
@@ -314,7 +314,7 @@ public int SalesByCategory(string cn, string ordYear)
314314

315315
// SalesByCategoryAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)
316316

317-
public int SalesByYear(DateTime? p1, DateTime? p2)
317+
public int SalesByYear(DateTime? p1 = null, DateTime? p2 = null)
318318
{
319319
var p1Param = new NpgsqlParameter { ParameterName = "p1", SqlDbType = SqlDbType.date, Direction = ParameterDirection.Input, Value = p1.GetValueOrDefault() };
320320
if (!p1.HasValue)
@@ -632,7 +632,7 @@ public int CustOrderHist(string x)
632632

633633
// CustOrderHistAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)
634634

635-
public int CustOrdersDetail(int? p1)
635+
public int CustOrdersDetail(int? p1 = null)
636636
{
637637
return 0;
638638
}
@@ -646,7 +646,7 @@ public int CustOrdersOrders(string p1)
646646

647647
// CustOrdersOrdersAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)
648648

649-
public int EmployeeSalesByCountry(DateTime? p1, DateTime? p2)
649+
public int EmployeeSalesByCountry(DateTime? p1 = null, DateTime? p2 = null)
650650
{
651651
return 0;
652652
}
@@ -660,7 +660,7 @@ public int SalesByCategory(string cn, string ordYear)
660660

661661
// SalesByCategoryAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)
662662

663-
public int SalesByYear(DateTime? p1, DateTime? p2)
663+
public int SalesByYear(DateTime? p1 = null, DateTime? p2 = null)
664664
{
665665
return 0;
666666
}

0 commit comments

Comments
 (0)