Tests implementiert
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Hochbaustatistik.Testing
|
|||||||
public class DatabaseOperationsTests
|
public class DatabaseOperationsTests
|
||||||
{
|
{
|
||||||
|
|
||||||
[Fact (Skip ="Keine Datenbank-Verbindung m<>glich")]
|
[Fact]//(Skip ="Keine Datenbank-Verbindung m<>glich")]
|
||||||
public void ConnectAndExecuteHochbauTest()
|
public void ConnectAndExecuteHochbauTest()
|
||||||
{
|
{
|
||||||
DatabaseOperations.conString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dborap04.stadtdo.de)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=bgvp.stadtdo.de)));user id=leser;password=leser;";
|
DatabaseOperations.conString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dborap04.stadtdo.de)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=bgvp.stadtdo.de)));user id=leser;password=leser;";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Hochbaustatistik.Testing
|
|||||||
{
|
{
|
||||||
public class EmailTests
|
public class EmailTests
|
||||||
{
|
{
|
||||||
[Theory(Skip = "Kein Lotus Notes installiert")]
|
[Theory(Skip = "Kein lotus installiert")]
|
||||||
[InlineData(@"C:\TEMP\test.txt")]
|
[InlineData(@"C:\TEMP\test.txt")]
|
||||||
public void SenMailTest(string attachment)
|
public void SenMailTest(string attachment)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ using Xunit;
|
|||||||
namespace Hochbaustatistik.Testing.Utilities
|
namespace Hochbaustatistik.Testing.Utilities
|
||||||
{
|
{
|
||||||
public class DataOpsTest
|
public class DataOpsTest
|
||||||
{
|
{
|
||||||
|
readonly string sourceFile = @"TestData\TestData.csv";
|
||||||
public readonly VorgangInpro vorgang = new VorgangInpro() { Schlussabnahme = "2022" };
|
public readonly VorgangInpro vorgang = new VorgangInpro() { Schlussabnahme = "2022" };
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
@@ -118,7 +119,7 @@ namespace Hochbaustatistik.Testing.Utilities
|
|||||||
Assert.Equal(expected2, actuals.ElementAt(1));
|
Assert.Equal(expected2, actuals.ElementAt(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(Skip = "Keine Datenbank-Verbindung möglich")]
|
[Fact]
|
||||||
public void MergeInproWithITNRWTest()
|
public void MergeInproWithITNRWTest()
|
||||||
{
|
{
|
||||||
var resultFile = @"C:\TEMP\hochbaustatistik.csv";
|
var resultFile = @"C:\TEMP\hochbaustatistik.csv";
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Hochbaustatistik.Testing
|
|||||||
public class WebTesting
|
public class WebTesting
|
||||||
{
|
{
|
||||||
|
|
||||||
[Fact (Skip ="Derzeit keine Daten zum Download vorhanden")]
|
[Fact (Skip ="Keine Daten zum Download vorhanden")]
|
||||||
public void DownloadList()
|
public void DownloadList()
|
||||||
{
|
{
|
||||||
//DownloadFolder
|
//DownloadFolder
|
||||||
@@ -58,7 +58,7 @@ namespace Hochbaustatistik.Testing
|
|||||||
driver.Quit();
|
driver.Quit();
|
||||||
|
|
||||||
Assert.True(File.Exists(pathDownloadedList));
|
Assert.True(File.Exists(pathDownloadedList));
|
||||||
File.Delete(pathDownloadedList);
|
//File.Delete(pathDownloadedList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Hochbaustatistik.Business
|
|||||||
#region Methods
|
#region Methods
|
||||||
string ReplaceHiphenWithSlash(string aktenzeichen)
|
string ReplaceHiphenWithSlash(string aktenzeichen)
|
||||||
{
|
{
|
||||||
var regex = new Regex(Regex.Escape("-"),RegexOptions.None,TimeSpan.FromMilliseconds(5));
|
var regex = new Regex(Regex.Escape("-"));
|
||||||
string res = regex.Replace(aktenzeichen, "/", 1);
|
string res = regex.Replace(aktenzeichen, "/", 1);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -66,7 +65,6 @@ namespace Hochbaustatistik.Business
|
|||||||
public string Aktenstandort { get; set; }
|
public string Aktenstandort { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
[ExcludeFromCodeCoverage]
|
|
||||||
public override string GenerateVorgang(Vorgang v)
|
public override string GenerateVorgang(Vorgang v)
|
||||||
{
|
{
|
||||||
StringBuilder sbInpro = new StringBuilder();
|
StringBuilder sbInpro = new StringBuilder();
|
||||||
|
|||||||
@@ -92,27 +92,81 @@ namespace Hochbaustatistik.Database
|
|||||||
vorgangInproHochbau.ZdA = reader.GetValue(6).ToString();
|
vorgangInproHochbau.ZdA = reader.GetValue(6).ToString();
|
||||||
|
|
||||||
vorgangInproHochbau.Eingangsdatum = reader.GetValue(7).ToString().Split(' ').FirstOrDefault();
|
vorgangInproHochbau.Eingangsdatum = reader.GetValue(7).ToString().Split(' ').FirstOrDefault();
|
||||||
|
var tempDate = reader.GetValue(8).ToString();
|
||||||
vorgangInproHochbau.Genehmigung = reader.GetValue(8).ToString() == null ? "" : reader.GetValue(8).ToString().Split(' ').FirstOrDefault();
|
|
||||||
|
if (tempDate == null)
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Genehmigung = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Genehmigung = tempDate.Split(' ').FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
vorgangInproHochbau.Freigabe = reader.GetValue(9).ToString();
|
vorgangInproHochbau.Freigabe = reader.GetValue(9).ToString();
|
||||||
vorgangInproHochbau.Statistik_Relevant = reader.GetValue(10).ToString();
|
vorgangInproHochbau.Statistik_Relevant = reader.GetValue(10).ToString();
|
||||||
vorgangInproHochbau.Statistik1 = reader.GetValue(11).ToString();
|
vorgangInproHochbau.Statistik1 = reader.GetValue(11).ToString();
|
||||||
vorgangInproHochbau.Statistik2 = reader.GetValue(12).ToString();
|
vorgangInproHochbau.Statistik2 = reader.GetValue(12).ToString();
|
||||||
|
|
||||||
vorgangInproHochbau.Genehmigung_Gemeldet = reader.GetValue(13).ToString() == null ? "" : reader.GetValue(13).ToString().Split(' ').FirstOrDefault();
|
tempDate = reader.GetValue(13).ToString();
|
||||||
|
if (tempDate == null)
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Genehmigung_Gemeldet = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Genehmigung_Gemeldet = tempDate.Split(' ').FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
vorgangInproHochbau.Fertigstellung_Gemeldet = reader.GetValue(14).ToString() == null ? "" : reader.GetValue(14).ToString().Split(' ').FirstOrDefault();
|
tempDate = reader.GetValue(14).ToString();
|
||||||
vorgangInproHochbau.Baubeginn = reader.GetValue(15).ToString() == null ? "" : reader.GetValue(15).ToString().Split(' ').FirstOrDefault();
|
if (tempDate == null)
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Fertigstellung_Gemeldet = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Fertigstellung_Gemeldet = tempDate.Split(' ').FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
vorgangInproHochbau.Teilrohbauabnahme = reader.GetValue(16).ToString() == null ? "" : reader.GetValue(16).ToString().Split(' ').FirstOrDefault();
|
tempDate = reader.GetValue(15).ToString();
|
||||||
|
if (tempDate == null)
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Baubeginn = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Baubeginn = tempDate.Split(' ').FirstOrDefault();
|
||||||
|
}
|
||||||
|
tempDate = reader.GetValue(16).ToString();
|
||||||
|
if (tempDate == null)
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Teilrohbauabnahme = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Teilrohbauabnahme = tempDate.Split(' ').FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
vorgangInproHochbau.Rohbauabnahme = reader.GetValue(17).ToString() == null ? "" : reader.GetValue(17).ToString().Split(' ').FirstOrDefault();
|
tempDate = reader.GetValue(17).ToString();
|
||||||
|
if (tempDate == null)
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Rohbauabnahme = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Rohbauabnahme = tempDate.Split(' ').FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
vorgangInproHochbau.Schlussabnahme = reader.GetValue(18).ToString() == null ? "" : reader.GetValue(18).ToString().Split(' ').FirstOrDefault();
|
tempDate = reader.GetValue(18).ToString();
|
||||||
|
if (tempDate == null)
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Schlussabnahme = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vorgangInproHochbau.Schlussabnahme = tempDate.Split(' ').FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
string tempDate = string.Empty;
|
|
||||||
if (tempDate == null)
|
if (tempDate == null)
|
||||||
{
|
{
|
||||||
vorgangInproHochbau.Vorjahr = "";
|
vorgangInproHochbau.Vorjahr = "";
|
||||||
|
|||||||
@@ -76,7 +76,20 @@ namespace Hochbaustatistik.Utilities
|
|||||||
|
|
||||||
return az;
|
return az;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ExcludeFromCodeCoverage]
|
||||||
|
public string ApplyLastAzToNewAz(string az, string currentName, string currentStrasse, LastData ld)
|
||||||
|
{
|
||||||
|
int linguName = String.Compare(currentName, ld.name, StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
int linguStrasse = String.Compare(currentStrasse, ld.strasse, StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
|
||||||
|
if (linguName > 0 || linguStrasse > 0)
|
||||||
|
{
|
||||||
|
az = ld.az;
|
||||||
|
}
|
||||||
|
return az;
|
||||||
|
}
|
||||||
|
|
||||||
[ExcludeFromCodeCoverage]
|
[ExcludeFromCodeCoverage]
|
||||||
private void CheckForDoubleSlashAndCorrect(ref string az)
|
private void CheckForDoubleSlashAndCorrect(ref string az)
|
||||||
{
|
{
|
||||||
@@ -173,7 +186,7 @@ namespace Hochbaustatistik.Utilities
|
|||||||
public bool IsValid(string az)
|
public bool IsValid(string az)
|
||||||
{
|
{
|
||||||
string pattern = @"\b(61[/][0-9]{1}[-][0-9]{1}[-][0-9]{6})";
|
string pattern = @"\b(61[/][0-9]{1}[-][0-9]{1}[-][0-9]{6})";
|
||||||
Regex r = new Regex(pattern,RegexOptions.None, TimeSpan.FromMilliseconds(5));
|
Regex r = new Regex(pattern);
|
||||||
bool matched = r.IsMatch(az);
|
bool matched = r.IsMatch(az);
|
||||||
bool len = az.Length == 13;
|
bool len = az.Length == 13;
|
||||||
if (matched && len)
|
if (matched && len)
|
||||||
@@ -286,7 +299,8 @@ namespace Hochbaustatistik.Utilities
|
|||||||
VorgangInpro vorgangHochbauInpro = DatabaseOperations.ConnectAndExecuteHochbau(vorgang);
|
VorgangInpro vorgangHochbauInpro = DatabaseOperations.ConnectAndExecuteHochbau(vorgang);
|
||||||
if (vorgangHochbauInpro.IdStrasse == null)
|
if (vorgangHochbauInpro.IdStrasse == null)
|
||||||
{
|
{
|
||||||
vorgangHochbauInpro = DatabaseOperations.ConnectAndExecuteHochbau(vorgang, Convert.ToInt32(identifikator));
|
vorgangHochbauInpro = DatabaseOperations.ConnectAndExecuteHochbau(vorgang, Convert.ToInt32(identifikator));// Convert.ToInt32(ReshapeIdentifikator(hochbauListe.ElementAt(record).Identifikator)));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (vorgang.Aktenzeichen.Equals("NOT_CORRECTED"))
|
if (vorgang.Aktenzeichen.Equals("NOT_CORRECTED"))
|
||||||
{
|
{
|
||||||
@@ -302,7 +316,7 @@ namespace Hochbaustatistik.Utilities
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private static class Nested
|
private class Nested
|
||||||
{
|
{
|
||||||
// Tell C# compiler not to mark type as beforefieldinit (https://csharpindepth.com/articles/BeforeFieldInit)
|
// Tell C# compiler not to mark type as beforefieldinit (https://csharpindepth.com/articles/BeforeFieldInit)
|
||||||
static Nested()
|
static Nested()
|
||||||
@@ -317,5 +331,13 @@ namespace Hochbaustatistik.Utilities
|
|||||||
{
|
{
|
||||||
_logger.Info("Singleton erzeugt.");
|
_logger.Info("Singleton erzeugt.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct LastData
|
||||||
|
{
|
||||||
|
public string az;
|
||||||
|
public string ident;
|
||||||
|
public string name;
|
||||||
|
public string strasse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
Hochbaustatistik/config/Jenkinsfile
vendored
2
Hochbaustatistik/config/Jenkinsfile
vendored
@@ -46,7 +46,7 @@ pipeline
|
|||||||
environment
|
environment
|
||||||
{
|
{
|
||||||
scannerHome = "C:\\home\\jenkins\\tools\\hudson.plugins.sonar.MsBuildSQRunnerInstallation\\C_sonar-runner"
|
scannerHome = "C:\\home\\jenkins\\tools\\hudson.plugins.sonar.MsBuildSQRunnerInstallation\\C_sonar-runner"
|
||||||
token = 'sqa_a11eb81bb62f3777b11679484aee7e65ed739ef2'
|
token = 'sqa_71202f188aacbe40492ba767cf3e841179d3f41a'
|
||||||
project = 'hochbaustatistik'
|
project = 'hochbaustatistik'
|
||||||
}
|
}
|
||||||
steps
|
steps
|
||||||
|
|||||||
Reference in New Issue
Block a user