From 853257491b6ba87af38aec83ed9f67cd47dedb18 Mon Sep 17 00:00:00 2001 From: hulivet1 Date: Wed, 12 Oct 2022 11:58:16 +0200 Subject: [PATCH] Ajout de test --- Code/ConsEco.sln | 9 ++++++--- Code/TestsUnitaires/TU_Compte.cs | 16 ++++++++++++++++ Code/TestsUnitaires/TestsUnitaires.csproj | 4 ++++ Code/TestsUnitaires/UnitTest1.cs | 11 ----------- 4 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 Code/TestsUnitaires/TU_Compte.cs delete mode 100644 Code/TestsUnitaires/UnitTest1.cs diff --git a/Code/ConsEco.sln b/Code/ConsEco.sln index ad4e961..78d70d3 100644 --- a/Code/ConsEco.sln +++ b/Code/ConsEco.sln @@ -5,11 +5,14 @@ VisualStudioVersion = 17.2.32616.157 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IHM", "IHM\IHM.csproj", "{355FC972-9C0D-4CBD-8003-EFBDACA7CFFF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{ACFA83F8-98C8-43AE-9328-B3F751098FFA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj", "{ACFA83F8-98C8-43AE-9328-B3F751098FFA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestFonctionnel", "TestFonctionnel\TestFonctionnel.csproj", "{7AC4F84F-1124-4EC1-BF38-17F3F4FBEB3E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFonctionnel", "TestFonctionnel\TestFonctionnel.csproj", "{7AC4F84F-1124-4EC1-BF38-17F3F4FBEB3E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestsUnitaires", "TestsUnitaires\TestsUnitaires.csproj", "{B1AE713C-B5DE-4E81-A33F-818AAD0548A7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestsUnitaires", "TestsUnitaires\TestsUnitaires.csproj", "{B1AE713C-B5DE-4E81-A33F-818AAD0548A7}" + ProjectSection(ProjectDependencies) = postProject + {ACFA83F8-98C8-43AE-9328-B3F751098FFA} = {ACFA83F8-98C8-43AE-9328-B3F751098FFA} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Code/TestsUnitaires/TU_Compte.cs b/Code/TestsUnitaires/TU_Compte.cs new file mode 100644 index 0000000..c9e5891 --- /dev/null +++ b/Code/TestsUnitaires/TU_Compte.cs @@ -0,0 +1,16 @@ +using Model; + +namespace TestsUnitaires +{ + public class TU_Compte + { + [Fact] + public void Ctor_Compte() + { + Compte c = new Compte("Crédit Agricole", 20000); + Assert.NotNull(c); + Assert.Equal("Crédit Agricole", c.Nom); + Assert.Equal(20000, c.Solde); + } + } +} \ No newline at end of file diff --git a/Code/TestsUnitaires/TestsUnitaires.csproj b/Code/TestsUnitaires/TestsUnitaires.csproj index 89d8ebd..5f195f2 100644 --- a/Code/TestsUnitaires/TestsUnitaires.csproj +++ b/Code/TestsUnitaires/TestsUnitaires.csproj @@ -21,4 +21,8 @@ + + + + diff --git a/Code/TestsUnitaires/UnitTest1.cs b/Code/TestsUnitaires/UnitTest1.cs deleted file mode 100644 index 8813a19..0000000 --- a/Code/TestsUnitaires/UnitTest1.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace TestsUnitaires -{ - public class UnitTest1 - { - [Fact] - public void Test1() - { - - } - } -} \ No newline at end of file