From 3b009da2b246373726f50c96bd6f235cd6c61e64 Mon Sep 17 00:00:00 2001 From: Anthony RICHARD Date: Wed, 3 May 2023 19:13:32 +0200 Subject: [PATCH] =?UTF-8?q?d=C3=A9pendances?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Console/Program.cs | 5 +- .../{Console.csproj => TestsConsole.csproj} | 0 .../{Administrateur.cs => Admin.cs} | 6 +- Sources/Stim.Model/Game.cs | 4 +- .../{Stim.Model.csproj => Model.csproj} | 0 Sources/Stim.Model/Review.cs | 4 +- Sources/Stim.Model/User.cs | 4 +- Sources/Stim.sln | 12 ++-- Sources/TestConsole/Program.cs | 4 ++ Sources/TestConsole/TestConsole.csproj | 10 +++ Sources/TestProject1/Test.csproj | 28 ++++++++ Sources/TestProject1/UnitTest1.cs | 15 ++++ Sources/TestProject1/Usings.cs | 1 + .../Properties/AssemblyInfo.cs | 20 ++++++ Sources/UnitTestProject1/UnitTest1.cs | 15 ++++ .../UnitTestProject1/UnitTestProject1.csproj | 68 +++++++++++++++++++ Sources/UnitTestProject1/packages.config | 5 ++ 17 files changed, 184 insertions(+), 17 deletions(-) rename Sources/Console/{Console.csproj => TestsConsole.csproj} (100%) rename Sources/Stim.Model/{Administrateur.cs => Admin.cs} (69%) rename Sources/Stim.Model/{Stim.Model.csproj => Model.csproj} (100%) create mode 100644 Sources/TestConsole/Program.cs create mode 100644 Sources/TestConsole/TestConsole.csproj create mode 100644 Sources/TestProject1/Test.csproj create mode 100644 Sources/TestProject1/UnitTest1.cs create mode 100644 Sources/TestProject1/Usings.cs create mode 100644 Sources/UnitTestProject1/Properties/AssemblyInfo.cs create mode 100644 Sources/UnitTestProject1/UnitTest1.cs create mode 100644 Sources/UnitTestProject1/UnitTestProject1.csproj create mode 100644 Sources/UnitTestProject1/packages.config diff --git a/Sources/Console/Program.cs b/Sources/Console/Program.cs index 83fa4f4..fab7381 100644 --- a/Sources/Console/Program.cs +++ b/Sources/Console/Program.cs @@ -1,2 +1,3 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using namespace Models; + +Game game = new Game(); \ No newline at end of file diff --git a/Sources/Console/Console.csproj b/Sources/Console/TestsConsole.csproj similarity index 100% rename from Sources/Console/Console.csproj rename to Sources/Console/TestsConsole.csproj diff --git a/Sources/Stim.Model/Administrateur.cs b/Sources/Stim.Model/Admin.cs similarity index 69% rename from Sources/Stim.Model/Administrateur.cs rename to Sources/Stim.Model/Admin.cs index cfa9fc7..63f9737 100644 --- a/Sources/Stim.Model/Administrateur.cs +++ b/Sources/Stim.Model/Admin.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stim.Model +namespace Model { - internal class Administrateur : User + public class Admin : User { public int Permission { @@ -18,7 +18,7 @@ namespace Stim.Model } private int permission; - public Administrateur(string username, string biographie, string email, string password, int perm) + public Admin(string username, string biographie, string email, string password, int perm) : base(username, biographie, email, password) { Permission = perm; diff --git a/Sources/Stim.Model/Game.cs b/Sources/Stim.Model/Game.cs index f2f6ab7..f0e3d90 100644 --- a/Sources/Stim.Model/Game.cs +++ b/Sources/Stim.Model/Game.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stim.Model +namespace Model { - internal class Game + public class Game { public string Name { diff --git a/Sources/Stim.Model/Stim.Model.csproj b/Sources/Stim.Model/Model.csproj similarity index 100% rename from Sources/Stim.Model/Stim.Model.csproj rename to Sources/Stim.Model/Model.csproj diff --git a/Sources/Stim.Model/Review.cs b/Sources/Stim.Model/Review.cs index 1f09f03..d6c1543 100644 --- a/Sources/Stim.Model/Review.cs +++ b/Sources/Stim.Model/Review.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Stim.Model +namespace Model { - internal class Review + public class Review { public float Rate { diff --git a/Sources/Stim.Model/User.cs b/Sources/Stim.Model/User.cs index e4f4e98..f600ff6 100644 --- a/Sources/Stim.Model/User.cs +++ b/Sources/Stim.Model/User.cs @@ -5,9 +5,9 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; -namespace Stim.Model +namespace Model { - internal class User + public class User { static int nbUser = 0; private int id; diff --git a/Sources/Stim.sln b/Sources/Stim.sln index fb27def..44b5865 100644 --- a/Sources/Stim.sln +++ b/Sources/Stim.sln @@ -5,9 +5,9 @@ VisualStudioVersion = 17.0.31611.283 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stim", "Stim\Stim.csproj", "{88365436-AFDF-4183-B010-C13784779E6B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Console", "Console\Console.csproj", "{D1C5D8F9-A7E8-4D52-9A7E-15373CAD5C08}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Stim.Model\Model.csproj", "{BA382A71-FDE3-4B0A-BC0D-7BA62BFC4866}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stim.Model", "Stim.Model\Stim.Model.csproj", "{BA382A71-FDE3-4B0A-BC0D-7BA62BFC4866}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "TestProject1\Test.csproj", "{6E6EDD37-C911-486A-9157-53C9F2D144D7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,14 +21,14 @@ Global {88365436-AFDF-4183-B010-C13784779E6B}.Release|Any CPU.ActiveCfg = Release|Any CPU {88365436-AFDF-4183-B010-C13784779E6B}.Release|Any CPU.Build.0 = Release|Any CPU {88365436-AFDF-4183-B010-C13784779E6B}.Release|Any CPU.Deploy.0 = Release|Any CPU - {D1C5D8F9-A7E8-4D52-9A7E-15373CAD5C08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D1C5D8F9-A7E8-4D52-9A7E-15373CAD5C08}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D1C5D8F9-A7E8-4D52-9A7E-15373CAD5C08}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D1C5D8F9-A7E8-4D52-9A7E-15373CAD5C08}.Release|Any CPU.Build.0 = Release|Any CPU {BA382A71-FDE3-4B0A-BC0D-7BA62BFC4866}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BA382A71-FDE3-4B0A-BC0D-7BA62BFC4866}.Debug|Any CPU.Build.0 = Debug|Any CPU {BA382A71-FDE3-4B0A-BC0D-7BA62BFC4866}.Release|Any CPU.ActiveCfg = Release|Any CPU {BA382A71-FDE3-4B0A-BC0D-7BA62BFC4866}.Release|Any CPU.Build.0 = Release|Any CPU + {6E6EDD37-C911-486A-9157-53C9F2D144D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E6EDD37-C911-486A-9157-53C9F2D144D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E6EDD37-C911-486A-9157-53C9F2D144D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E6EDD37-C911-486A-9157-53C9F2D144D7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Sources/TestConsole/Program.cs b/Sources/TestConsole/Program.cs new file mode 100644 index 0000000..0028d25 --- /dev/null +++ b/Sources/TestConsole/Program.cs @@ -0,0 +1,4 @@ +namespace TestConsole +{ + Game game = new Game(); +} \ No newline at end of file diff --git a/Sources/TestConsole/TestConsole.csproj b/Sources/TestConsole/TestConsole.csproj new file mode 100644 index 0000000..40c60dd --- /dev/null +++ b/Sources/TestConsole/TestConsole.csproj @@ -0,0 +1,10 @@ + + + + Exe + net6.0 + enable + enable + + + diff --git a/Sources/TestProject1/Test.csproj b/Sources/TestProject1/Test.csproj new file mode 100644 index 0000000..7af5bae --- /dev/null +++ b/Sources/TestProject1/Test.csproj @@ -0,0 +1,28 @@ + + + + net7.0 + enable + enable + + false + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/Sources/TestProject1/UnitTest1.cs b/Sources/TestProject1/UnitTest1.cs new file mode 100644 index 0000000..e6c1847 --- /dev/null +++ b/Sources/TestProject1/UnitTest1.cs @@ -0,0 +1,15 @@ +using Model; + +namespace Test +{ + public class UnitTest1 + { + [Fact] + public void Test1() + { + string[] tags = { "1", "2", "3" }; + Game game = new("Elden Ring", "C'est un jeu vraiment cool !", 2022, tags); + + } + } +} \ No newline at end of file diff --git a/Sources/TestProject1/Usings.cs b/Sources/TestProject1/Usings.cs new file mode 100644 index 0000000..8c927eb --- /dev/null +++ b/Sources/TestProject1/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/Sources/UnitTestProject1/Properties/AssemblyInfo.cs b/Sources/UnitTestProject1/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3c8e078 --- /dev/null +++ b/Sources/UnitTestProject1/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("UnitTestProject1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("workgroup")] +[assembly: AssemblyProduct("UnitTestProject1")] +[assembly: AssemblyCopyright("Copyright © workgroup 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("ac41933b-9f30-4d1e-ad83-0e4f0946e21b")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Sources/UnitTestProject1/UnitTest1.cs b/Sources/UnitTestProject1/UnitTest1.cs new file mode 100644 index 0000000..c6faeaf --- /dev/null +++ b/Sources/UnitTestProject1/UnitTest1.cs @@ -0,0 +1,15 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; + +namespace UnitTestProject1 +{ + [TestClass] + public class UnitTest1 + { + [TestMethod] + public void TestMethod1() + { + + } + } +} diff --git a/Sources/UnitTestProject1/UnitTestProject1.csproj b/Sources/UnitTestProject1/UnitTestProject1.csproj new file mode 100644 index 0000000..0bb0217 --- /dev/null +++ b/Sources/UnitTestProject1/UnitTestProject1.csproj @@ -0,0 +1,68 @@ + + + + + + Debug + AnyCPU + {AC41933B-9F30-4D1E-AD83-0E4F0946E21B} + Library + Properties + UnitTestProject1 + UnitTestProject1 + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/Sources/UnitTestProject1/packages.config b/Sources/UnitTestProject1/packages.config new file mode 100644 index 0000000..4ea5008 --- /dev/null +++ b/Sources/UnitTestProject1/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file