Merge dev-model-tu -> dev-model
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
commit
9b90b53f29
@ -0,0 +1,42 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CI_Linaris_pipeline
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest
|
||||
commands:
|
||||
- cd Sources/
|
||||
- dotnet restore Linaris.sln
|
||||
- dotnet build Linaris.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0
|
||||
- dotnet publish Linaris/Linaris.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk
|
||||
- name: tests
|
||||
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest
|
||||
commands:
|
||||
- cd Sources/
|
||||
- dotnet restore Linaris.sln
|
||||
- dotnet test Linaris.sln --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0
|
||||
depends_on: [build]
|
||||
- name: code-inspection
|
||||
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7-maui
|
||||
secrets: [ SECRET_SONAR_LOGIN ]
|
||||
environment:
|
||||
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
||||
sonar_token:
|
||||
from_secret: SECRET_SONAR_LOGIN
|
||||
project_key: Linaris_LEMAIRE_LABORIE
|
||||
coverage_exclusions: "Tests/**"
|
||||
commands:
|
||||
- cd Sources/
|
||||
- dotnet restore Linaris.sln
|
||||
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token}
|
||||
- dotnet build Linaris.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0
|
||||
- dotnet test Linaris.sln --logger trx --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
|
||||
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
||||
- dotnet publish Linaris/Linaris.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}
|
||||
depends_on: [tests]
|
@ -0,0 +1,46 @@
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace TestUnitaires
|
||||
{
|
||||
public class TU_Album
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Fenêtre sur Rue","album2. jpg","Un banger","Sortie : 2012")]
|
||||
[InlineData("Adios Bahamas", "album.jpg", "Un banger", "Sortie : 2012")]
|
||||
[InlineData(null, "album2.jpg", "Un banger", "Sortie : 2012")]
|
||||
[InlineData("Dans La Légende", null, "Un banger", "Sortie : 2012")]
|
||||
[InlineData("Dans La Légende","album1.jpg", null, "Sortie : 2012")]
|
||||
[InlineData("Dans La Légende", "album1.jpg", "Un banger", null)]
|
||||
[InlineData("Dans La Légende", "album1jpg", "Un banger", "Sortie : 2012")]
|
||||
public void TU_Attributes(string nameAlbum, string url, string desc, string info)
|
||||
{
|
||||
Album album = new Album(nameAlbum, url, new Artist("test"), desc, info);
|
||||
Assert.True(album.Name != null && album.Name.Length < 75);
|
||||
Assert.True(album.ImageURL != null && album.ImageURL.Contains('.'));
|
||||
Assert.False(album.ImageURL.Contains(' '));
|
||||
Assert.True(album.Description != null && album.Description.Length < 500);
|
||||
Assert.True(album.Information != null && album.Information.Length < 500);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Fenêtre sur Rue", "album2. jpg", "Un banger", "Sortie : 2012")]
|
||||
[InlineData("Adios Bahamas", "album.jpg", "Un banger", "Sortie : 2012")]
|
||||
[InlineData(null, "album2.jpg", "Un banger", "Sortie : 2012")]
|
||||
[InlineData("Dans La Légende", null, "Un banger", "Sortie : 2012")]
|
||||
[InlineData("Dans La Légende", "album1.jpg", null, "Sortie : 2012")]
|
||||
[InlineData("Dans La Légende", "album1.jpg", "Un banger", null)]
|
||||
[InlineData("Dans La Légende", "album1jpg", "Un banger", "Sortie : 2012")]
|
||||
public void TU_Methods(string nameAlbum, string url, string desc, string info)
|
||||
{
|
||||
Album album = new Album(nameAlbum, url, new Artist("test"), desc, info);
|
||||
Title t = new Title("Débitage", "test. mp3", "Banger");
|
||||
album.AddTitle(t);
|
||||
Assert.Contains(t, album.Titles);
|
||||
album.RemoveTitle(t);
|
||||
Assert.DoesNotContain(t, album.Titles);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace TestUnitaires
|
||||
{
|
||||
|
||||
public class TU_Artist
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Hugo TSR")]
|
||||
[InlineData(null)]
|
||||
[InlineData("Hugo TSRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR")]
|
||||
public void TU_Attributes(string name)
|
||||
{
|
||||
Artist a = new Artist(name);
|
||||
Assert.True(a.Name != null && a.Name.Length < 75);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace TestUnitaires
|
||||
{
|
||||
|
||||
public class TU_CustomTitle
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Trajectoire","morceau1.png","Sortie : 2020", "Musique/test.mp3")]
|
||||
[InlineData(null, "morceau1.png", "Sortie : 2020", "Musique/test.mp3")]
|
||||
[InlineData("Trajectoire", null, "Sortie : 2020", "Musique/test.mp3")]
|
||||
[InlineData("Trajectoire", "morceau1.png", null, "Musique/test.mp3")]
|
||||
[InlineData("Trajectoire", "morceau1png", "Sortie : 2020", "Musique/test.mp3")]
|
||||
[InlineData("Trajectoire", "morceau1. png", "Sortie : 2020", "Musique/test.mp3")]
|
||||
[InlineData("Trajectoire", "morceau1.png", "Sortie : 2020", null)]
|
||||
public void TU_Attributes(string name, string url, string info, string path)
|
||||
{
|
||||
CustomTitle ct = new CustomTitle(name, url, info, path);
|
||||
Assert.True(ct.Name != null && ct.Name.Length < 75);
|
||||
Assert.True(ct.ImageURL != null && ct.ImageURL.Contains('.'));
|
||||
Assert.False(ct.ImageURL.Contains(' '));
|
||||
Assert.True(ct.Information != null && ct.Information.Length < 500);
|
||||
Assert.True(ct.Path != null && ct.Path.Contains('.'));
|
||||
Assert.False(ct.Path.Contains(' '));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace TestUnitaires
|
||||
{
|
||||
|
||||
public class TU_InfoTitle
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Trajectoire","morceau1.png","Sortie : 2020","Morceau de Népal",Genre.HIP_HOP)]
|
||||
[InlineData(null, "morceau1.png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", null, "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1.png", null, "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1. png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
public void TU_Attributes(string name, string url, string info, string desc, Genre g)
|
||||
{
|
||||
InfoTitle it = new InfoTitle(name, url, info, new Artist("test"), desc, g);
|
||||
Assert.True(it.Name != null && it.Name.Length < 75);
|
||||
Assert.True(it.ImageURL != null && it.ImageURL.Contains('.'));
|
||||
Assert.False(it.ImageURL.Contains(' '));
|
||||
Assert.True(it.Information != null && it.Information.Length < 500);
|
||||
Assert.True(it.Description != null && it.Description.Length < 500);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Trajectoire", "morceau1.png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData(null, "morceau1.png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", null, "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1.png", null, "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1. png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
public void TU_Methods(string name, string url, string info, string desc, Genre g)
|
||||
{
|
||||
InfoTitle it = new InfoTitle(name, url, info, new Artist("test"), desc, g);
|
||||
Artist a = new Artist("Lahuiss");
|
||||
it.AddFeat(a);
|
||||
Assert.Contains(a, it.Feat);
|
||||
it.RemoveFeat(a);
|
||||
Assert.DoesNotContain(a, it.Feat);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
using Model;
|
||||
using Model.Serialization;
|
||||
using Model.Stub;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NuGet.Frameworks;
|
||||
using System;
|
||||
|
||||
namespace TestUnitaires
|
||||
{
|
||||
|
||||
public class TU_Manager
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("Réference")]
|
||||
public void TU_Methods(string? test)
|
||||
{
|
||||
IDataManager DataManager = new LINQ_XML_Serialization();
|
||||
Playlist p = new Playlist(test, "PlaceHolder", "place.holder");
|
||||
Album album = new Album(test, "place.holder", new Artist("test"), "PlaceHolder", "PlaceHolder");
|
||||
CustomTitle t = new CustomTitle(test, "test. mp3", "Banger", "path");
|
||||
Manager m = new Manager(DataManager);
|
||||
m.AddCustomTitle(t);
|
||||
m.AddPlaylist(p);
|
||||
m.AddAlbum(album);
|
||||
Assert.Contains(t, m.CustomTitles);
|
||||
Assert.Contains(album, m.Albums);
|
||||
Assert.Contains(p, m.Playlists);
|
||||
m.RemovePlaylist(p);
|
||||
m.RemoveAlbum(album);
|
||||
m.RemoveCustomTitle(t);
|
||||
Assert.DoesNotContain(t, m.CustomTitles);
|
||||
Assert.DoesNotContain(p, m.Playlists);
|
||||
Assert.DoesNotContain(album, m.Albums);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace TestUnitaires
|
||||
{
|
||||
|
||||
public class TU_Playlist
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Sons Soirées","red-sky.png","Contient les sons que je mets quand je suis en soirée.")]
|
||||
[InlineData(null, "red-sky.png", "Contient les sons que je mets quand je suis en soirée.")]
|
||||
[InlineData("Sons Soirées", null, "Contient les sons que je mets quand je suis en soirée.")]
|
||||
[InlineData("Sons Soirées", "red-sky.png", null)]
|
||||
[InlineData("Sons Soirées", "redskypng", "Contient les sons que je mets quand je suis en soirée.")]
|
||||
[InlineData("Sons Soirées", "red-sky .png", "Contient les sons que je mets quand je suis en soirée.")]
|
||||
public void TU_Attributes(string name, string url, string desc)
|
||||
{
|
||||
Playlist p = new Playlist(name, desc, url);
|
||||
Assert.True(p.Name != null && p.Name.Length < 75);
|
||||
Assert.True(p.ImageURL != null && p.ImageURL.Contains('.'));
|
||||
Assert.False(p.ImageURL.Contains(' '));
|
||||
Assert.True(p.Description != null && p.Description.Length < 500);
|
||||
}
|
||||
[Theory]
|
||||
[InlineData("Sons Soirées", "red-sky.png", "Contient les sons que je mets quand je suis en soirée.")]
|
||||
[InlineData(null, "red-sky.png", "Contient les sons que je mets quand je suis en soirée.")]
|
||||
[InlineData("Sons Soirées", null, "Contient les sons que je mets quand je suis en soirée.")]
|
||||
[InlineData("Sons Soirées", "red-sky.png", null)]
|
||||
[InlineData("Sons Soirées", "redskypng", "Contient les sons que je mets quand je suis en soirée.")]
|
||||
[InlineData("Sons Soirées", "red-sky .png", "Contient les sons que je mets quand je suis en soirée.")]
|
||||
public void TU_Methods(string name, string url, string desc)
|
||||
{
|
||||
Playlist p = new Playlist(name, desc, url);
|
||||
CustomTitle t = new CustomTitle("Débitage","test. mp3","Banger","path");
|
||||
p.AddTitle(t);
|
||||
Assert.Contains(t,p.Titles);
|
||||
p.RemoveTitle(t);
|
||||
Assert.DoesNotContain(t,p.Titles);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace TestUnitaires
|
||||
{
|
||||
|
||||
public class TU_Title
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Trajectoire","morceau1.png","Sortie : 2020")]
|
||||
[InlineData(null, "morceau1.png", "Sortie : 2020")]
|
||||
[InlineData("Trajectoire", null, "Sortie : 2020")]
|
||||
[InlineData("Trajectoire", "morceau1.png", null)]
|
||||
[InlineData("Trajectoire", "morceau1png", "Sortie : 2020")]
|
||||
[InlineData("Trajectoire", "morceau1. png", "Sortie : 2020")]
|
||||
public void TU_Attributes(string name, string url, string info)
|
||||
{
|
||||
Title t = new Title(name, url, info);
|
||||
Assert.True(t.Name != null && t.Name.Length < 75);
|
||||
Assert.True(t.ImageURL != null && t.ImageURL.Contains('.'));
|
||||
Assert.False(t.ImageURL.Contains(' '));
|
||||
Assert.True(t.Information != null && t.Information.Length < 500);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1 @@
|
||||
global using Xunit;
|
Loading…
Reference in new issue