parent
b7670ae160
commit
371c778f0f
Binary file not shown.
@ -1,4 +1,40 @@
|
|||||||
# LolProject
|
# LOL-Project <img src="https://logo-marque.com/wp-content/uploads/2020/11/League-of-Legends-Embleme.png" width="40" >
|
||||||
|
|
||||||
Realization of an API and an ORM which will be linked to a database in the theme of League of legends
|
|
||||||
|
**Thème du projet** : Réalisation d'une API et d'un ORM(Entity Framework) qui seront reliés à une base de données dans le thème de League of legends <img src="https://logo-marque.com/wp-content/uploads/2020/11/League-of-Legends-Embleme.png" width="40" >
|
||||||
|
</br>
|
||||||
|
|
||||||
|
# Répartition du Gitlab
|
||||||
|
|
||||||
|
La racine de notre gitlab est composée de deux dossiers essentiels au projet:
|
||||||
|
|
||||||
|
[**src**](src) : **Toute la partie codage de l'application**
|
||||||
|
|
||||||
|
[**doc**](doc) : **Documentation de l'application**
|
||||||
|
|
||||||
|
👉 [**Solution de l'application**](src/EntityFramework_LoL/Sources/LeagueOfLegends.sln)
|
||||||
|
|
||||||
|
|
||||||
|
# Environnement de Travail
|
||||||
|
|
||||||
|
Mon environnement de travail se base sur plusieurs outils :👇
|
||||||
|
|
||||||
|
<div align = center>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
# Technicien en charge de l'application
|
||||||
|
|
||||||
|
⚙️ Emre KARTAL
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div align = center>
|
||||||
|
© Groupe 4
|
||||||
|
</div>
|
After Width: | Height: | Size: 960 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 92 KiB |
@ -0,0 +1,15 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ApiLol\ApiLol.csproj" />
|
||||||
|
<ProjectReference Include="..\DTO\DTO.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,23 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||||
|
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
|
||||||
|
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\ApiLol\ApiLol.csproj" />
|
||||||
|
<ProjectReference Include="..\..\StubLib\StubLib.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,61 @@
|
|||||||
|
using ApiLol.Controllers;
|
||||||
|
using DTO;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Model;
|
||||||
|
using StubLib;
|
||||||
|
|
||||||
|
namespace ApiTests
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class ChampionsControllerTest
|
||||||
|
{
|
||||||
|
private readonly StubData stub;
|
||||||
|
private readonly ChampionsControllerTest champs;
|
||||||
|
public ChampionsControllerTest()
|
||||||
|
{
|
||||||
|
stub = new StubData();
|
||||||
|
champs = new ChampionsController(stub);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async void TestGetChampions()
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var champion = champs.Get();
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
var objectResult = champion as OkObjectResult;
|
||||||
|
Assert.IsNotNull(objectResult);
|
||||||
|
|
||||||
|
var champions = objectResult?.Value as IEnumerable<Champion>;
|
||||||
|
Assert.IsNotNull(champions);
|
||||||
|
|
||||||
|
Assert.AreEqual(champions.Count(), await stub.ChampionsMgr.GetItems(0,5).Count());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async Task TestPostChampion()
|
||||||
|
{
|
||||||
|
//Arange
|
||||||
|
var ChampionDto = new ChampionDto
|
||||||
|
{
|
||||||
|
Name = "Sylas"
|
||||||
|
};
|
||||||
|
|
||||||
|
//Act
|
||||||
|
var championsResult = await champs.Post(ChampionDto);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
var objectResult = championsResult as OkObjectResult;
|
||||||
|
Assert.IsNotNull(objectResult);
|
||||||
|
|
||||||
|
var champions = objectResult?.Value as IEnumerable<Champion>;
|
||||||
|
Assert.IsNotNull(champions);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
global using Microsoft.VisualStudio.TestTools.UnitTesting;
|
Loading…
Reference in new issue