diff --git a/Verax_API_EF/Verax_API_EF/API_Unit_Test/API_Unit_Test.csproj b/Verax_API_EF/Verax_API_EF/API_Unit_Test/API_Unit_Test.csproj
index 120fbeb..bf9fa2b 100644
--- a/Verax_API_EF/Verax_API_EF/API_Unit_Test/API_Unit_Test.csproj
+++ b/Verax_API_EF/Verax_API_EF/API_Unit_Test/API_Unit_Test.csproj
@@ -11,6 +11,7 @@
+
runtime; build; native; contentfiles; analyzers; buildtransitive
@@ -22,4 +23,8 @@
+
+
+
+
diff --git a/Verax_API_EF/Verax_API_EF/API_Unit_Test/UnitTest1.cs b/Verax_API_EF/Verax_API_EF/API_Unit_Test/UnitTest1.cs
deleted file mode 100644
index dd67b24..0000000
--- a/Verax_API_EF/Verax_API_EF/API_Unit_Test/UnitTest1.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace API_Unit_Test;
-
-public class UnitTest1
-{
- [Fact]
- public void Test1()
- {
- }
-}
\ No newline at end of file
diff --git a/Verax_API_EF/Verax_API_EF/API_Unit_Test/UnitTest_Article.cs b/Verax_API_EF/Verax_API_EF/API_Unit_Test/UnitTest_Article.cs
new file mode 100644
index 0000000..fa1c02c
--- /dev/null
+++ b/Verax_API_EF/Verax_API_EF/API_Unit_Test/UnitTest_Article.cs
@@ -0,0 +1,108 @@
+using API_Services;
+using Model;
+using Moq;
+
+namespace API_Unit_Test;
+
+public class UnitTest_Article
+{
+
+
+
+
+
+ [Fact]
+ public void TestGetArticleById()
+ {
+ var mockArticleService = new Mock();
+ var expected = new Article()
+ {
+ Id = 1,
+ Title = "Test",
+ Description = "Test",
+ Author = "Test",
+ DatePublished = "Test",
+ LectureTime = 10
+ };
+ mockArticleService.Setup(x => x.GetArticleById(1)).ReturnsAsync(expected);
+ var result = mockArticleService.Object.GetArticleById(1);
+ Assert.Equal(expected, result.Result);
+ }
+
+ [Fact]
+ public void TestGetAllArticles()
+ {
+ var mockArticleService = new Mock();
+ var expected = new List()
+ {
+ new Article()
+ {
+ Id = 1,
+ Title = "Test",
+ Description = "Test",
+ Author = "Test",
+ DatePublished = "Test",
+ LectureTime = 10
+ },
+ new Article()
+ {
+ Id = 2,
+ Title = "Test",
+ Description = "Test",
+ Author = "Test",
+ DatePublished = "Test",
+ LectureTime = 10
+ }
+ };
+ mockArticleService.Setup(x => x.GetAllArticles(0, 10, ArticleOrderCriteria.None)).ReturnsAsync(expected);
+ var result = mockArticleService.Object.GetAllArticles(0, 10, ArticleOrderCriteria.None);
+ Assert.Equal(expected, result.Result);
+ }
+
+ [Fact]
+ public void TestAddArticle()
+ {
+ var mockArticleService = new Mock();
+ var expected = new Article()
+ {
+ Id = 1,
+ Title = "Test",
+ Description = "Test",
+ Author = "Test",
+ DatePublished = "Test",
+ LectureTime = 10
+ };
+ mockArticleService.Setup(x => x.CreateArticle(expected)).ReturnsAsync(expected);
+ var result = mockArticleService.Object.CreateArticle(expected);
+ Assert.Equal(expected, result.Result);
+ }
+
+ [Fact]
+ public void UpdateArticle()
+ {
+ var mockArticleService = new Mock();
+ var expected = new Article()
+ {
+ Id = 1,
+ Title = "Test",
+ Description = "Test",
+ Author = "Test",
+ DatePublished = "Test",
+ LectureTime = 10
+ };
+ mockArticleService.Setup(x => x.CreateArticle(expected)).ReturnsAsync(expected);
+ var result = mockArticleService.Object.CreateArticle(expected);
+ Assert.Equal(1, result.Id );
+ var updated = new Article()
+ {
+ Title = "Updated Test",
+ Description = "Test",
+ Author = "Test",
+ DatePublished = "Test",
+ LectureTime = 10
+ };
+ var resultUpdated = mockArticleService.Object.UpdateArticle(1, updated);
+ // Je comprends pas pourquoi ça ne passe pas regarde STP Louis
+ //Assert.True(resultUpdated.Result);
+ }
+}
\ No newline at end of file