generated from giis-uniovi/samples-giis-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05c28bf
commit 4682520
Showing
8 changed files
with
86 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,14 +255,13 @@ jobs: | |
# run: dotnet nuget add source https://apiint.nugettest.org/v3/index.json -n int.nugettest.org | ||
- name: Run test - ADO.NET | ||
run: dotnet test --logger "trx;LogFileName=../../reports/qacover-report.trx" QACoverTest/QACoverTest.csproj | ||
#- name: Run test - Entity Framework | ||
# run: dotnet test --logger "trx;LogFileName=../../reports/qacover-report-ef.trx" QACoverTestEf/QACoverTestEf.csproj | ||
- name: Run test - Entity Framework | ||
run: dotnet test --logger "trx;LogFileName=../../reports/qacover-report-ef.trx" QACoverTestEf/QACoverTestEf.csproj | ||
- name: Junit html report | ||
if: always() | ||
uses: javiertuya/[email protected] | ||
with: | ||
#net-trx-report: "net/reports/qacover-report.trx,net/reports/qacover-report-ef.trx" | ||
net-trx-report: "net/reports/qacover-report.trx" | ||
net-trx-report: "net/reports/qacover-report.trx,net/reports/qacover-report-ef.trx" | ||
net-surefire-folder: "net/target/surefire-reports" | ||
surefire-files: "net/target/surefire-reports/TEST-*.xml" | ||
report-dir: net/target/site | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
net/QACoverTestEf/Test4giis.Qacover.Ef.Sqlserver/TestSqlserverEvaluationEF.N.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,48 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore; | ||
using Giis.Qacover.Ef2driver; | ||
using Giis.Portable.Util; | ||
using Giis.Tdrules.Store.Rdb; | ||
using System.Linq; | ||
|
||
namespace Test4giis.Qacoverapp.Ef | ||
{ | ||
public class EfModel : Ef2InterceptorContext | ||
{ | ||
public DbSet<SimpleEfEntity> SimpleEntitys { get; set; } | ||
public DbSet<TestEfEntity> TestEfTable { get; set; } | ||
|
||
// Connection string uses the same configuration parameters that are used for ADO.NET tests | ||
private string GetConnectionString() | ||
{ | ||
string SetupPath = FileUtil.GetPath(Parameters.GetProjectRoot(), "..", "setup"); | ||
string DatabaseProperties = FileUtil.GetPath(SetupPath, "database.properties"); | ||
string url = new JdbcProperties().GetProp(DatabaseProperties, "qacover.netcore.qacoverdb.sqlserver.url"); | ||
string user = new JdbcProperties().GetProp(DatabaseProperties, "qacover.netcore.qacoverdb.sqlserver.user"); | ||
string EnvironmentProperties = FileUtil.GetPath(SetupPath, "environment.properties"); | ||
string password = new JdbcProperties().GetEnvVar(EnvironmentProperties, "TEST_" + "sqlserver".ToUpper() + "_PWD"); | ||
return url + ";UID=" + user + ";PWD=" + password; | ||
} | ||
|
||
protected override void OnConfiguring(DbContextOptionsBuilder options) | ||
{ | ||
base.OnConfiguring(options); //para que se instale el interceptor | ||
options.UseSqlite("Data Source=" + FileUtil.GetPath(Parameters.GetProjectRoot(), "TestEf.db")); | ||
base.OnConfiguring(options); // base class (Ef2InterceptorContext) will install the interceptor | ||
options.UseSqlServer(GetConnectionString()); | ||
} | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
// Disable generated unicode literals | ||
foreach (var property in modelBuilder.Model.GetEntityTypes() | ||
.SelectMany(e => e.GetProperties().Where(p => p.ClrType == typeof(string)))) | ||
{ | ||
property.SetIsUnicode(false); | ||
} | ||
} | ||
} | ||
|
||
public class SimpleEfEntity | ||
public class TestEfEntity | ||
{ | ||
public int Id { get; set; } | ||
public Int16 Num { get; set; } | ||
public string Text { get; set; } | ||
public int Num { get; set; } | ||
public string Txt { get; set; } | ||
} | ||
} |