Update issues of DataContractPersistance
continuous-integration/drone/push Build is failing Details

pull/23/head
Antoine PEREDERII 2 years ago
commit 1abee355f0

@ -31,19 +31,19 @@ steps:
secrets: [ SECRET_SONAR_LOGIN ] secrets: [ SECRET_SONAR_LOGIN ]
settings: settings:
# accessible en ligne de commande par ${PLUGIN_SONAR_HOST} # accessible en ligne de commande par ${PLUGIN_SONAR_HOST}
SONAR_HOST: https://codefirst.iut.uca.fr/sonar/ sonar_host: https://codefirst.iut.uca.fr/sonar/
# accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN} # accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN}
SONNAR_TOKEN: sonar_token:
from_secret: SECRET_SONAR_LOGIN from_secret: SECRET_SONAR_LOGIN
commands: commands:
- cd src/Banquale/ - cd src/Banquale/
- dotnet restore Banquale.sln - dotnet restore Banquale.sln
- dotnet sonarscanner begin /k:Banquale /d:sonar.host.url=$SONAR_HOST /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$SONAR_TOKEN - dotnet sonarscanner begin /k:"Banquale" /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
- dotnet build Banquale.sln -c Release --no-restore - dotnet build Banquale.sln -c Release --no-restore
- dotnet test Banquale.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" - dotnet test Banquale.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" # - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
- dotnet publish Banquale/Banquale.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk # - dotnet publish Banquale/Banquale.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk
- dotnet sonarscanner end /d:sonar.login=$SONAR_TOKEN - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
depends_on: [tests] depends_on: [tests]
- name: generate-and-deploy-docs - name: generate-and-deploy-docs

@ -3,6 +3,10 @@
# Banquale # Banquale
[![Build Status](https://codefirst.iut.uca.fr/api/badges/antoine.perederii/Banquale/status.svg)](https://codefirst.iut.uca.fr/antoine.perederii/Banquale) [![Build Status](https://codefirst.iut.uca.fr/api/badges/antoine.perederii/Banquale/status.svg)](https://codefirst.iut.uca.fr/antoine.perederii/Banquale)
[![Quality Gate Status](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Banquale&metric=alert_status&token=1a49717e4d2f15e2eecaaa971ebd8c83fb9bd5c5)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Banquale)
[![Bugs](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Banquale&metric=bugs&token=1a49717e4d2f15e2eecaaa971ebd8c83fb9bd5c5)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Banquale)
[![Coverage](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Banquale&metric=coverage&token=1a49717e4d2f15e2eecaaa971ebd8c83fb9bd5c5)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Banquale)
[![Vulnerabilities](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Banquale&metric=vulnerabilities&token=1a49717e4d2f15e2eecaaa971ebd8c83fb9bd5c5)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Banquale)
# Table of Content # Table of Content
[overview--big-picture](#overview--big-picture) | [Features](#features) | [Getting Started](#getting-started) | [Prerequisites](#prerequisites) [overview--big-picture](#overview--big-picture) | [Features](#features) | [Getting Started](#getting-started) | [Prerequisites](#prerequisites)

@ -75,6 +75,7 @@
<MauiXaml Remove="Resources\Images\Images.xaml" /> <MauiXaml Remove="Resources\Images\Images.xaml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Persistances\" />
<Folder Include="Stub\" /> <Folder Include="Stub\" />
<Folder Include="DataContractPersistance\" /> <Folder Include="DataContractPersistance\" />
</ItemGroup> </ItemGroup>

@ -1,7 +1,16 @@
<<<<<<< HEAD
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Banquale.Model; using Banquale.Model;
=======
using Banquale.Model;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Xml;
>>>>>>> 771dfebd455ecbc2d933450b081c14049561ab24
namespace Banquale.DataContractPersistance namespace Banquale.DataContractPersistance
{ {
@ -11,7 +20,11 @@ namespace Banquale.DataContractPersistance
public string FileName { get; set; } = "ClientAndTransactionsList.xml"; public string FileName { get; set; } = "ClientAndTransactionsList.xml";
public string FilePath { get; set; } = Path.Combine(Directory.GetCurrentDirectory(), "..//XML1_folder")/*"/Users/Perederii/SAE/Banquale/src/Banquale/Banquale/XML_folder"*/; public string FilePath { get; set; } = Path.Combine(Directory.GetCurrentDirectory(), "..//XML1_folder")/*"/Users/Perederii/SAE/Banquale/src/Banquale/Banquale/XML_folder"*/;
public string FileName { get; set; } = "nomFichier.xml";
public string FilePath2 { get; set; } = "..\\Persistances";
public string FilePath { get; set; } = "C:\\Users\\louve\\depot\\Banquale\\src\\Banquale\\Persistances";
public (List<Client>, List<Transactions>) ChargeDonnee() public (List<Client>, List<Transactions>) ChargeDonnee()
{ {
@ -38,11 +51,15 @@ namespace Banquale.DataContractPersistance
Directory.CreateDirectory(FilePath); Directory.CreateDirectory(FilePath);
} }
using (Stream s = File.Create(Path.Combine(FilePath, FileName))) XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(Path.Combine(FilePath, FileName)))
{ {
serializer.WriteObject(s, t); using (XmlWriter writer = XmlWriter.Create(tw, settings))
{
serializer.WriteObject(writer, t);
}
} }
} }
} }
} }

@ -1,12 +1,15 @@
using System; using System;
using System.Runtime.Serialization;
namespace Banquale.Model namespace Banquale.Model
{ {
[DataContract]
public class Manager public class Manager
{ {
[DataMember]
public List<Client> ListeClients { get; private set; } public List<Client> ListeClients { get; private set; }
[DataMember]
public List<Transactions> ListeTransactions { get; private set; } public List<Transactions> ListeTransactions { get; private set; }
public IPersistanceManager Persistance { get; set; } public IPersistanceManager Persistance { get; set; }

Loading…
Cancel
Save