This chapter explains the Set Up of RestSharp package in Unit test Project or How to Configure Visual studio project with RestSharp? To do that, follow the below steps:
- Create Unit Test Project
- Download Rest-Sharp package using NuGet Manager
How to Configure Visual Studio project with RestSharp?
Pre-Requisites
Let us set up our development environment to write some RESTful web services tests. In order to set up the environment we need to have the Visual Studio installed on the machine. In case you are new to this, please take a look at the tutorial How to Install Visual Studio.
Creating Unit Test Project
1.Open visual studio and click on file menu tab File => New => Project.
2. Select Test from the left Navigation and choose Unit Test Project as shown in the image. It will give options to mention the Project name, location & solution name. Give sensible name to the project, just for the sake of simplicity, enter RestSharpExample and give the preferred location to the project. Click on OK button to proceed. Let the solution name as same as RestSharpExample.
Download RestSharp package using NuGet Manager
1.Go to Tools >> Nuget Package Manager >> Manage Nuget Packages for Solution....
2) In the Seach Box, search for RestSharp. This will take few seconds to populate the results. Once done, just select RestSharp and click on Install to start the installation process.
3. Once Visual Studio is finished with the successful installation of the RestSharp, it will generate the output logs. Also this also can viewed at the right side in the Solution Explorer under References.