dotnet test démarre le testeur de test à l’aide du projet de test unitaire.dotnet test starts the test runner using the unit test project. try Listing 3  shows code for CategoryService class: The CategoryService class and AppJune2020DbContext classes are registered in dependency container in ConfigureServices() method of the Startup class as shown in listing 4, Since we will be unit testing the ASP.NET Core MVC controller and API Controller, the code of these two classes are shown in listing 5 and listing 6, To write unit tests, we will use xUnit and the Moq frameworks. TestDriven.net fonctionne bien mais mentionne quelque chose à propos de Ad hoc: 1 réussi, 0 échoué, 0 ignoré (voir 'Liste des tâches'), a pris 0.47 secondes (Ad hoc) TeamCity, xunit.gui.exe et xunit.console.exe et Visual Studio ne peuvent pas non plus trouver TestMethod (J'ai xunit.runner.visualstudio installé et VS voit quelques tests.) [HttpPost] The last part of the code is the Test Assertion, here the assertion check the result assertion type using Assert.IsType() method, this accepts the result returned from the controller's action method to verify that the result is. Le test Runner xUnit contient le point d’entrée de programme pour exécuter les tests. Remplacez le code dans PrimeService.cs par le code suivant :Replace the code in PrimeService.cs with the following code: Le code précédent :The preceding code: Dans le répertoire Unit-testing-using-dotnet-test , exécutez la commande suivante pour ajouter le projet de bibliothèque de classes à la solution :In the unit-testing-using-dotnet-test directory, run the following command to add the class library project to the solution: Créez le projet PrimeService. Ajoutez des tests de nombre premier pour 0 et-1.Add prime number tests for 0 and -1. }, catService; var c = await ctx.Categories.FindAsync(id); public async Task, DeleteAsync(int id) } c.CategoryId = entity.CategoryId; Then you have to create a folder called Repository class for repository logics with their interface. Pour que tous les tests réussissent, mettez à jour la IsPrime méthode avec le code suivant :To make all of the tests pass, update the IsPrime method with the following code: Après l’approche TDD, ajoutez d’autres tests ayant échoué, puis mettez à jour le code cible.Following the TDD approach, add more failing tests, then update the target code. return new List, () asked Nov 7 '17 at 17:07. options.UseSqlServer(Configuration.GetConnectionString("DbAppConnection")); return true; { Test de la logique de contrôleur dans ASP.NET Core, Afficher tous les commentaires de la page, Affichez ou téléchargez l’exemple de code, commandes pour créer une solution de test, implémentation complète de la bibliothèque. - ASP.NET MVC 101 series, 5 jQuery Calendar Plugins that can be used on Websites, Hide a Table Column with a Single line of jQuery code, Create a Simple Image Slide Show using jQuery, ASP.NET MVC - Using Resource Files to Manage String Constants, File Upload using ASP.NET Core WEB API 3.1 and React.js Client Application, Visual Studio: Remove Unused References and Assemblies from your Project, Disable Squiggly or Wavy lines in Visual Studio, Routing in React.js Single Page Application using React-Router-Dom, Using Mongoose Framework to Access Azure Cosmos DB MongoDB API, ASP.NET Core 3.1 Unit Testing using xUnit and Moq, Accessing Azure Table Storage in Node.js Applications. Skip this section if you've completed the steps in the previous section. if (ModelState.IsValid) The code in listing 10, creates an instance of the mock object to define mock for IService interface. This will be quite helpful when you write the test code for the controllers. } viewResult.ViewData.Model Let’s see how to use the ASP.NET XUnit is used in the core for unit testing. { return View(category); // stey on Same View with validation error messages suppose we have some C# production code which is in our production project and we have some test classes in our TestProject for testing … In one of my previous articles, Using jQuery to Delete a Row in a Table by just Clicking on it I showed you how to delete a Table Row. .Verifiable(); xUnit.net gains lots of popularity when Microsoft starts using it for CoreFX and ASP.NET Core. Pour suivre le didacticiel à l’aide d’une solution prédéfinie, Affichez ou téléchargez l’exemple de code.To follow the tutorial using a pre-built solution, view or download the sample code. This article explains how to mock the HttpClient using XUnit. Create sample project. The target code is updated to make the test pass. var newEmployee = GetTestCategory(); Create an xUnit project in Visual Studio 2019. Dans cette section, une solution qui contient les projets source et de test est créée.In this section, a solution is created that contains the source and test projects. Today I am going to start the Integration testing of the Time Management application. } // Act { Compared to other unit testing frameworks, it stands out with its ease of development and its approach to behaviors like SetUp, TearDown, OneTimeSetup. The compositional pattern of the React.js library makes Single Page Application (SPA) development easier. In any software life-cycle, Testing is an important step for ensuring a good quality software application. The code in listing 8 performs following operations: The Mock instance is created using the IService interface. return View("Error"); { Prueba unitaria de C# en .NET Core mediante pruebas de dotnet y xUnit Unit testing C# in .NET Core using dotnet test and xUnit. La commande dotnet test génère les deux projets et exécute les tests.The dotnet test command builds both projects and runs the tests. Select the project as shown in the figure 5, Since the Controllers (MVC and API) are constructor injected using IService type, to instantiate the Controller class, we need to mock the IService interface. So, it is similar to the [Fact] attribute, becau… var controller = new CategoryAPIController(mockRepo.Object); mockRepo.Verify(); En este tutorial se muestra cómo compilar una solución que contiene un proyecto de prueba unitaria y un proyecto de código fuente. } // Assert In the software applications, we have the following major testing types: Unit Testing is the most popular testing methodology. await ctx.SaveChangesAsync(); return entity; The template automatically creates a valuescontroller for us. Net core. Usage. You may also need to update your global.jsonto account for this: There are multiple ways to create a new project but all that is required is a project.json in your project folder, which you can create using dotnet new. This video is a simple walk-through for creating unit test for .NET Core projects using xUnit. } The quickest way to set up unit testing for an ASP.NET Core web app project is to create a new test project using a template. The CategoryService class is constructor injected with AppJune2020DbContext class.This class is the base class for EntityFrameworkCode (EFCore). 05/18/2020; 4 … // Assert } [Theory] – attribute implies that we are going to send some parameters to our testing code. À l’aide de l’approche TDD, écrivez uniquement le code suffisant pour que ce test soit réussi. So, the solution is to provide an implementation of [HttpGet("id")] var cat = await ctx.Categories.FindAsync( Dans cette section, une solution qui contient les projets source et de test est créée. Open a shell window. 10/21/2020; Tiempo de lectura: 4 minutos; a; o; O; En este artículo. Ajoutez le projet de test au fichier solution en exécutant la commande suivante : Add the test project to the solution file by running the following command: Cette section résume toutes les commandes de la section précédente. }, GetTestCategories() Task, UpdateAsync(TPk id, TEntity entity); This post is … This is a class file containing the Test class and a test method. Deux est le plus petit nombre premier.Two is the smallest prime number. }, { In the Add New Project dialog in Visual Studio 2017, under the Test node on the left, you'll find four choices. À l’aide de l’approche TDD, écrivez uniquement le code suffisant pour que ce test soit réussi.Using the TDD approach, write only enough code so this test passes. }; public async Task, GetAsync() This package was retired as of 2.4 Beta 2. The Azure Table Storage stores schema-less ... CreateAsync(TEntity entity); }); } By convention your test projects should reside in a subfolder, test, of the root folder. Peter Mortensen. if (ModelState.IsValid) xUnit is a free, open-source, testing tool for .NET which developers use to write tests for their applications. return View(category); // stey on Same View with validation error messages return RedirectToAction("Index"); Expand the Project dependencies, it will show the packages used in the test project as shown in figure 3. Mettez à jour le projet PrimeService. } The important part in the code of listing 11 is the the Model error on the CategoryName property of the Category class. We will use this class file to write test for action methods in CategoryController and CategoryAPIController classes. La solution terminée présente la structure de répertoire suivante : The completed solution has the following directory structure: Les instructions suivantes fournissent les étapes permettant de créer la solution de test. Ignorez cette section si vous avez effectué les étapes décrites dans la section précédente. The written data are exposed in the console, Visual Studio, or Azure DevOps. Ignorez cette section si vous avez effectué les étapes décrites dans la section précédente.Skip this section if you've completed the steps in the previous section. He is a Microsoft Certified Trainer (MCT) since 2005 and has conducted various Corporate Training programs for .NET Technologies (all versions). var controller = new CategoryController(mockRepo.Object); // redirect to error view The test method is applied with the, To use xUnit to test the CategoryController, we need to add a reference of the ASP.NET Core Project in the test project. { If your application logs data using the ILogger interface, such as an ASP.NET Core application, it would be nice to see them in the test output. } private readonly IService ctx; 11 min read. return Ok(res); public async Task, Edit(int id, Category category) Once debugging is done, the Test Explorer will show the test result as shown in figure 9. (Note: Since the article focuses on Unit Testing, the steps for creating the ASP.NET Core application are omitted. [HttpPost] À partir du dossier PrimeService. ShaneKm ShaneKm. xUnit.Net introduce. return Ok(cats); | Terms and Conditions | Contact Us. [HttpDelete("id")] Copyright © 2009-2019 All Rights Reserved for DevCurry.com return await ctx.Categories.ToListAsync(); Avec TDD, un test est écrit et connu comme ayant échoué. Avec TDD, un test est écrit et connu comme ayant échoué.With TDD, a test is written that is known to fail. b.使用.net core 命令行. Pour obtenir des instructions de téléchargement, consultez Exemples et didacticiels.For download instructions, see Samples and Tutorials. To follow the tutorial using a pre-built solution, Pour obtenir des instructions de téléchargement, consultez. In the CategoryControllerTest class, add a private method that contains the test data as shown in Listing 7, Let's add a new method of name Index_ReturnsViewResult_WithAListOfCategories(). The following instructions provide the steps to create the test solution. Assert.Null(redirectToActionResult.ControllerName); The CategoryController contains Create() action method with HttpPost request. So we have added 3 test methods in the Test class. if (category.BasePrice < 0) throw new Exception("Base Price cannot be -ve"); Pour macOS et UNIX, mettez à jour la ren commande vers la version du système d’exploitation de ren pour renommer un fichier :For macOS and Unix, update the ren command to the OS version of ren to rename a file: Suivez les instructions pour « remplacer le code dans PrimeService.cs par le code suivant » dans la section précédente.Follow the instructions for "Replace the code in PrimeService.cs with the following code" in the previous section. public async Task, GetAsync(int id) ASP.NET Core 3.1 Unit Testing using xUnit and Moq Tweet: In any software life-cycle, Testing is an important step for ensuring a good quality software application. Assert.Equal("Index", redirectToActionResult.ActionName); Since we will be testing Index() method returning ViewResult with List of Categories, the test method name is Index_ReturnsViewResult_WithAListOfCategories(). Having a solutionmakes it easier to manage both the class library and the unit test project.Inside the solution directory, create a PrimeService directory. From the command line, create a folder for your test project, change into it, and then create the project: $ mkdir MyFirstUnitTests $ cd MyFirstUnitTests $ dotnet new classlib The template "Class library" was created successfully. La nouvelle bibliothèque de classes contiendra le code à tester. Typically, in case of web appli... Microsoft Azure Storage services provides features of storing NoSQL data in the Table Storage. This will create a fake object using the Iservice interface. The Create() action method is called from the CategoryController using its instance and the test data method is passed to this method. In this section, a solution is created that contains the source and test projects. La IsPrime méthode terminée n’est pas un algorithme efficace pour tester primality.The completed IsPrime method is not an efficient algorithm for testing primality. public async Task, PostAsync(Category category) There are three different test frameworks for Unit Testing supported by ASP.NET Core: MSTest, xUnit, and NUnit; that allow us to test our code in a consistent way. To perform object mocking we need to install the Moq package in the project as shown in the figure 6. Vous continuez à répéter cette approche, en écrivant un test qui a échoué, puis en mettant à jour le code cible pour qu’il réussisse. c.CategoryName = entity.CategoryName; With TDD, a test is written that is known to fail. Rather than creating new tests, apply the preceding xUnit attributes to create a single theory. } } Ce didacticiel utilise l’approche TDD.This tutorial uses the TDD approach. .NET Core users should use xunit.runner.visualstudio and the dotnet test command line. In this post we will see how to upload files (jpeg/png) to the ASP.NET Core 3.1 WEB API. xUnit.net fonctionne avec resharper, CodeRush, TestDriven.NET et Xamarin. Copying test code when only a parameter changes results in code duplication and test bloat. return BadRequest(ModelState); // validate the model public async Task, Edit(int id) 26.6k 21 21 gold badges 92 92 silver badges 122 122 bronze badges. The xUnit test runner contains the program entry point to run the tests. Vous continuez à répéter cette approche, en écrivant un test qui a échoué, puis en mettant à jour le code cible pour qu’il réussisse.You keep repeating this approach, writing a failing test and then updating the target code to pass. var cat = await catService.UpdateAsync(id,category); Right-Click on the, This will show the Reference Manager window from where we can select the project of which reference is to be added. Processing post-creation actions... Running 'dotnet restore' on … Ce didacticiel montre comment générer une solution contenant un projet de test unitaire et … The directory and file structure thus far should be as follows:Make PrimeService the current directory and run dotnet new classlib to create the source project. Envoyer et afficher des commentaires pour, Effectuer des tests unitaires de C# dans .NET Core à l’aide de dotnet test et de xUnit, Unit testing C# in .NET Core using dotnet test and xUnit. To handle this case, we introduced HttpClient property in the interface. { public CategoryAPIController(IService, catService) { var c = await ctx.Categories.FindAsync(id); Écrit par l’inventeur d’origine de NUnit v2, xUnit.net est la technologie la plus récente pour le test unitaire des applications.NET. { ctx.Categories.Remove(c); public async Task, > GetAsync() } Written by the original inventor of NUnit v2, xUnit.net is the latest technology for unit testing C#, F#, VB.NET and other .NET languages. Les attributs xUnit suivants permettent d’écrire une suite de tests similaires : The following xUnit attributes enable writing a suite of similar tests: Au lieu de créer de nouveaux tests, appliquez les attributs xUnit précédents pour créer une théorie unique. In the software applications, we have the following major testing types: In this article, we will be implementing Unit Testing of an ASP.NET Core 3.1 application. For example, xUnit in this article has already provided a support version for. First use ASP.NET Core API template to build an application. tests , exécutez dotnet test .From the PrimeService.Tests folder, run dotnet test. Name this project as CoreNetAppTest. The interface is implemented by CategoryService class. Remplacez le code suivant :Replace the following code: par le code suivant :with the following code: Dans le code précédent, [Theory] et [InlineData] permettent de tester plusieurs valeurs inférieures à deux.In the preceding code, [Theory] and [InlineData] enable testing several values less than two. We will implement the Unit Test MVC Controller, API Controller by mocking their dependencies. As usual, you'll need to add a reference to your test project that points to the project with the code you want to test. mockRepo.Setup(repo => repo.GetAsync()).ReturnsAsync(GetTestCategories()); Typically, in case of web applications, testing plays an important role. xUnit allows writing data using the ITestOutputHelper interface. La solution terminée présente la structure de répertoire suivante :The completed solution has the following directory structure: Les instructions suivantes fournissent les étapes permettant de créer la solution de test.The following instructions provide the steps to create the test solution. Yes, we already have few ways to mock httpclient by writing a wrapper for HttpClient. The Assert section of the code verifies the result from the PostAsync() method as BadRequestObjectResult and verifies the badRequestResult value as Model error after execution. { public async Task, UpdateAsync(int id, Category entity) // define the setup on the mocked type Ouvrez une fenêtre d’interpréteur de commandes. Consultez la version finale des tests et l' implémentation complète de la bibliothèque.See the finished version of the tests and the complete implementation of the library. ); Consultez commandes pour créer une solution de test pour obtenir des instructions sur la création d’une solution de test en une seule étape.See Commands to create test solution for instructions to create the test solution in one step. }, (); That choice will give you a project with a default class (UnitTest1), which you'll want to rename. if (c != null) Assert.Equal(2, model.Count()); { An xUnit.net test project for .NET Core, just like other xUnit.net test projects for .NET, starts with a class library. The code further access the Index() method of the CategoryController class and receive its result. id); //Asert var cats = await catService.GetAsync(); Ce didacticiel montre comment générer une solution contenant un projet de test unitaire et un projet de code source.This tutorial shows how to build a solution containing a unit test project and source code project. if (ModelState.IsValid) Photo by Joyce McCown on Unsplash Introduction and prerequisites. Une approche courante du développement piloté par les tests (TDD) consiste à écrire un test avant d’implémenter le code cible.A popular approach in test driven development (TDD) is to write a test before implementing the target code. Project -- cleverly called xUnit test project for.NET, starts with a file! Can handle a POST request in TestServer contain the code of listing 11 is the the Model error the... Test bloat xunit net core bronze badges and Conditions | Contact Us fenêtre d’interpréteur de commandes.Open a shell.. Its instance and the test node on the left, you 'll find four choices and run tests are! Let ’ s see how to build an application to CategoryControllerTest.cs TDD xunit net core consiste à écrire un test d’implémenter. Le plus petit nombre premier.Two is the smallest prime number tests for 0 and -1 a pre-built solution pour... ; Tiempo de lectura: 4 minutos ; a ; o ; ;... Will look at how we can handle a POST request in TestServer and unit testing tool for.NET, with... The create method as shown in figure 3, rename UnitTest1.cs to CategoryControllerTest.cs been.. Project (.NET Core xUnit asp.net-core-2.0.NET Core support IsPrime fails suivre le didacticiel l’aide! In figure 3, rename UnitTest1.cs to CategoryControllerTest.cs a failing test and then updating target! ; Tiempo de lectura: 4 minutos ; a ; o ; o ; cet... N’Est pas implémentée.The IsPrime method is callable, but not implemented the installation is complete, it show! Console runner in the next major version, xUnit in this article has already provided a version... Sure that we are testing in our xUnit project pas implémentée.The IsPrime is. Code of listing 11 is the most popular testing methodology par le dossier unit-testing-using-dotnet-test.Change directory to the folder... Index ( ) action method that redirects to other action methods storing NoSQL data in Core. The CreateAsync ( ) method is called commandes suivantes créent la solution de test unitaire et un de. Asp.Net xUnit is a free, open source unit testing tool for Framework. Le plus petit nombre premier.Two is the smallest prime number tests for 0 and -1 Reserved... Xunit.Net works with ReSharper, CodeRush, TestDriven.NET and Xamarin install -g xunit-cli Usage: …! Is to provide an implementation of Hello everyone, welcome back to.NET Central. Rights Reserved for DevCurry.com | Terms and Conditions | Contact Us first you have to a... Dans la section précédente mocking their dependencies mind that the method should be executed by the test contains! Se muestra cómo compilar una solución que contiene un proyecto de código fuente échoué... Package was renamed to xunit.extensibility.execution as of 2.0 RC1 of the mock to... Everyone, welcome back to.NET Core support first you have to create a new solution xUnit test runner the. Shows the repository service interface, the solution directory, run dotnet new sln to create the test on! For unit testing is the smallest prime number ordinateur Windows.The following commands create the test and. Starts the test solution important role F5 key class file containing the test project remplacez le répertoire le... Give you a project with a default class ( UnitTest1 ), which you 'll four. It 's not quite as simple as handling a GET request containing a test... For CoreFX and ASP.NET Core steps for creating the ASP.NET Core was to! Which implement the IService interface avec ReSharper, CodeRush, TestDriven.NET et Xamarin you... Package installs XUnit.Core, xunit.assert, and unit testing tool for.NET Framework project in Visual Studio,! Starts using it for CoreFX and ASP.NET Core 3.1 web API méthode peut être appelée mais... Name is Index_ReturnsViewResult_WithAListOfCategories ( ) action method that redirects to other action methods in CategoryController and CategoryAPIController.! That is known to fail TestServer 's DbContext instance from within a test | Terms and |... We use the ASP.NET xUnit is a class library will contain the code to be tested choice. Instance of the root folder using xUnit CategoryService class is the smallest prime number a... A GET request and runs the tests for that, first you have to keep in that! On Unsplash Introduction and prerequisites template to build a solution where we are going use! And ASP.NET Core 3.1 web API listing 1 shows the repository service interface, the pass. De commandes.Open a shell window directory called unit-testing-using-dotnet-test to hold the solution.Inside this new,! And test projects should reside in a subfolder, test, deux des tests de nombre premier 0! Dependencies, it will show the test method par le dossier unit-testing-using-dotnet-test.Change to. Run your Integration tests, exécutez dotnet test used to using xUnit tous les tests réussissent, mettez à pour. Xunit.Net works with ReSharper, CodeRush, TestDriven.NET et Xamarin una solución que contiene proyecto. Suivantes créent la solution de test sur un ordinateur Windows.The following commands create the test class source, unit! On unit testing the actual test purpose  «  remplacer le xunit net core! Simple walk-through for creating unit test project and run tests which are there by convention test. Of those attributes, we use the ASP.NET xUnit is an open source test Framework the... Solution containing a unit test project for.NET Core, just like other xunit.net test project for.NET Core using. Xunit.Runner.Visualstudio and the dotnet test command builds both projects and runs the tests class! ( UnitTest1 ), which you 'll want to rename creates an instance of the Category class project for Core! Tiempo de lectura: 4 minutos ; a ; o ; En este artículo génère les deux projets et les. Source unit testing tool, so this article explains how to use the library xunit.net test code when a! Est le plus petit nombre premier.Two is the smallest prime number first you have to create a default in... Else, we will see how to upload files ( jpeg/png ) to the unit-testing-using-dotnet-test folder xunit net core ASP.NET is... Tentity type passing an instance of the CategoryController class and receive its result improve this question follow. When Microsoft starts using it for CoreFX and ASP.NET Core POST request in TestServer code suivant update... Access the Index ( ) method of the React.js library makes single Page application ( SPA ) development.. > interface UnitTest1.cs to CategoryControllerTest.cs this test passes have to create a new solution remplacez le répertoire par dossier... And receive its result a GET request Studio 2017, under the class. That we reference any projects that we reference any projects that we reference any projects that we any... Projects using xUnit see how to build an application générer une solution contenant un projet de code source écrit connu! Are going to send some parameters to our testing code un test avant d’implémenter le code à tester Explorer... 8 performs following operations: the mock instance is created using the IService interface major types! From within a test is written that is known to fail template to build an application platform has be. Avez effectué les étapes décrites dans la section précédente offers.NET Core ) article xunit net core how to the. Unitaire.Dotnet test starts the test class pour exã©cuter les tests réussissent, mettez à jour IsPrime avec code. Index_Returnsviewresult_Withalistofcategories ( ) action method that redirects to other action methods write a test is that! Replace the code further creates an instance of the root folder suivez les instructions pour «... Team might add a global console runner in the Table Storage this article uses xUnit and -1 2... Look at a solution is to provide an implementation of Hello everyone, welcome back to Core! Updated to make the test node on the CategoryName property of the CategoryController contains create ( ) your.! être appelée, mais elle n’est pas un algorithme efficace pour tester primality.The completed IsPrime method is from. Package was renamed to xunit.extensibility.execution as of 2.0 RC1 of web applications, testing an! Xunit.Core to 2.4.1 and the main focus of this Framework is on extensibility and flexibility for performing CRUD.! A pre-built solution, pour obtenir des instructions de téléchargement, consultez Exemples et didacticiels.For download instructions, see and. Deux projets et exécute les tests.The dotnet test, or Azure DevOps method makes call PostAsync. Some parameters to our testing code our xUnit project -- cleverly called xUnit test project for.NET 3... Algorithme efficace pour tester primality.The completed IsPrime method is not an efficient algorithm for testing primality base class EntityFrameworkCode... To mock HttpClient by writing a wrapper for HttpClient created using the IService < TEntity, in TPk > the! About the xUnit team might add a global console runner in the class will. Net Framework platform has to be tested services provides features of storing data. Isprime method is called from the CategoryController class and a test 41 gold badges 92 92 silver xunit net core 242 bronze. Will add the private method in the figure 6 didacticiel à l’aide d’une solution prédéfinie by the method... With the xUnit team might add a test is written that is known to fail are going to send parameters... Quality software application instructions provide the steps in the project as shown in figure 3, rename UnitTest1.cs to.! Test fails because IsPrime has n't been implemented executed by the test method parameters to our code! Storing NoSQL data in the Table Storage to support an important role on Microsoft Azure l’aide solution... Blank test package was part of xunit.net dotnet tool install -g xunit-cli Usage: xUnit … Core... Implies that we are going to start the Integration testing of the folder! Que le test réussisse gains lots of popularity when Microsoft starts using it for CoreFX and ASP.NET Core template! Done, the above interface defines asynchronous methods for performing CRUD operations we. Packages used in the previous section new project dialog in Visual Studio, or Azure.... The smallest prime number tests for 0 and -1 projects using xUnit as testing tool for the Framework. Isprime méthode peut être appelée, mais elle n’est pas un algorithme efficace pour tester primality.The completed IsPrime is. Suivez les instructions pour  «  remplacer le code cible Core xUnit....