
Explore API testing from basics to advanced using RestSharp, covering get requests, asynchronous operations, serializing and deserializing responses, and building a framework with dependency injection.
Get hands-on with API testing using RestSharp on a Darknet web API project, exploring authentication with a token, swagger docs, and endpoints for product data, creation, and file uploads.
Explore the basics of APIs, how to test them, and the main protocols, including REST, SOAP, RPC, and event-driven streaming, with ASP.NET Core Web API using RestSharp.
Test API after development with UI tools like Postman, Fiddler, SoapUI, and Thunderclap; explore Swagger documentation and code-based testing approaches on Darknet web API endpoints for authentication, products, and components.
Discover RestSharp, the tool of choice for API testing in the Darknet framework, with features like serialization, fully async requests, authentication configuration, and support for bodies, files, and parameters.
Set up a RestSharp API testing workflow by creating a RestSharp client and RestRequest, performing get, post, put, patch, and delete operations with async assertions.
Compare Visual Studio 2022 and Rider IDE for C# development by showing RestSharp project setup, NuGet installation, and unit testing across platforms.
Write a simple RestSharp API test against a localhost endpoint to fetch a product by id, using a rest client, a rest request, async get, and handle SSL validation.
Fix HTTPS errors in RestSharp during local app testing by configuring RestClientOptions with a remote certificate validation callback, bypassing SSL checks, and validating responses with fluent assertions.
Learn realistic API testing with RestSharp by exercising the get by ID operation using GetAsync<>, asserting with Fluent Assertions and modeling product and components in the application under test.
Demonstrates performing a get operation with url segments to parameterize the endpoint, using RestRequest.AddUrlSegment to replace the dynamic id and verify results.
Learn to test a get operation using query parameters in RestSharp, by wiring id and name into the endpoint to fetch a product and verify details like price.
Execute a RestSharp post operation by sending a json body to create a product, serialized from a product object, and observe new cabinet or printer entries with incrementing IDs.
Run fast tests with RestSharp and xUnit, covering get and post operations, and learn to fuse test code with application code for end-to-end testing.
Learn how to merge api test code with the development codebase to align tests with the app, reducing false negatives and enabling tests to run in the ci pipeline.
Merge development and test code by integrating projects into a single solution, copying the RestSharp demo, adjusting references, and resolving dependencies to build and run the unified app.
Run api tests alongside the application under test in the same solution using Visual Studio 2022 or Rider; the app runs while tests execute from Test Explorer.
Master file upload testing with RestSharp by sending multipart/form-data to post endpoints, validating a 201 created response and proper file placement in the server during unit tests.
Enable jwt token authentication in restsharp, unlock access to protected endpoints by logging in to obtain a token, then authorize requests and run tests.
Learn to pass a jwt token in the request header as a bearer authorization to access protected operations, such as getting a product by id, and adjust header naming.
Learn how to migrate and integrate authentication into existing API tests using RestSharp by encapsulating token retrieval and header authentication across scenarios.
Explore refactoring existing RestSharp-based tests by injecting the claimed option in constructors, reducing per-method clients, and adopting dependency injection and web application factories for more robust, modern testing.
Refactor the api test setup by centralizing rest client initialization in a base rest library, exposing a read-only client via a getter, and updating tests to use it.
Leverage a class fixture with the rest library to simplify object initialization by injecting the rest library into constructors, reducing boilerplate and enabling dependency injection in tests.
Learn how dependency injection and inversion of control decouple core logic by replacing concrete classes with interfaces, enabling automatic mapping of dependencies and cleaner, more testable design.
Register interfaces to concrete classes in the startup service collection, configure the DI container with singleton lifetimes, and enable extended dependency injection for realistic RestSharp testing.
Refactor code toward a library-like framework, making it robust and reusable for rest operations. Apply builder pattern in C#, with a factory and library to streamline requests, headers, and body.
Learn to implement a rest builder using the set builder pattern in C# for rest requests with headers, body, and post/get operations.
Build a rest factory and rest builder using the builder pattern to create a fluent rest framework for tests, including get operations with headers and query parameters.
Register interfaces in dependency injection and migrate to a fluent rest client approach, debug test failures, and update token handling to enable post and get operations with RestSharp.
Develop a robust framework change by fixing async token handling in api tests with RestSharp, extracting token into a constructor, and streamlining unit tests for reliability.
Learn how to perform integration testing in C# .NET using RestSharp by running the app in memory with the WebApplicationFactory, enabling isolated, fast, in-pipeline tests without deployment.
Use WebApplicationFactory to run the GraphQL ASP.NET API in memory, create a RestSharp integration test, and call get product by id with authentication.
Learn how to bootstrap a web app with WebApplicationFactory, authenticate via login, obtain a token, and authorize API calls to fetch products using an in-memory setup.
Switch from http client to RestSharp for api testing by using WebApplicationFactory in-memory application. Learn to perform post and get operations with bearer token authorization, speeding up tests.
Fuse the web application factory with the rest library client to run in memory tests for a GraphQL app, wiring dependencies and creating a default client for streamlined API testing.
Explore spec flow integration for behavior driven development in API testing, enabling BDD-based tests with SpecFlow and running the app in memory via a web application factory.
Bootstrap the system under test with a web application factory to spin up the app in memory, enabling integration tests with a RestSharp client without the application running.
Learn how to run tests in a user-friendly, behavior-driven way using SpecFlow and BDD, install the SpecFlow plugin, create a new project, and write feature files with step definitions.
Implement step definitions for RestSharp tests using SpecFlow, wire a Rest client via scenario context, perform requests with dynamic data, and validate responses with assertions.
Launch RestSharp tests with SpecFlow by initializing drivers via before-scenario hooks, wiring scenario context, and authenticating API calls with a token in the authorization header.
Explore adding complex scenarios to api testing with RestSharp and framework development, tackle complex workflow and Json responses, learn assertions, and review reporting options and ci cd operation.
Upgrade the API project to net seven and sharp 110, update the rest app, and run via docker-compose to handle complex scenarios with nested product, component, manufacturer, and address data.
Create a complex specflow scenario to perform two similar api requests, compare first and second responses with fluent assertions, and address system created date and user created date discrepancies.
Learn to ignore date time properties in complex json responses during api testing with RestSharp and Fluent Assertions, using BeEquivalent options to allow within 24 hours.
Verify that product one and product two have the same manufacturer addresses by inspecting the first component's manufacturers, then exclude address IDs in fluent assertions for nested json.
Explore adding ExtentReports to your api testing workflow, enabling BDD based SpecFlow reporting for features and scenarios, with reports for passing and failing tests in dotnet projects.
Initialize ExtentReport in the project with ExtentReports and ExtentSparkReporter, set the HTML report path from the executing assembly, and use hooks to manage feature and scenario data.
Create an Extent report for api tests by building feature and scenario nodes, capturing given, when, then steps, and using before and after step hooks to show data.
Explore failing scenarios in extent reports for rest api testing, showing how a failing product id marks a failed scenario and step in spec flow and xUnit reports.
This course API testing with RestSharp along with framework development is designed in such a way that anyone who has basic knowledge in C# will perform complete API testing along with Business logic without any difficulty.
Languages and Libraries used.
Visual Studio 2022/Rider with C# 10 and .NET 7
RestSharp
XUnit
Fluent Assertion
Specflow
Xunit.DependencyInjection
WebApplicationFactory
Extent Reports
GitHub Actions for CI/CD
GraphQL.Client
This course is the only course on the internet that covers so many different real-world scenarios which are not covered elsewhere. With that said, here is a high-level overview of the course topics
Complete basics of API testing with RestSharp
Full understanding of different libraries in RestSharp
Execute with Async and Non-Async methods
Advanced operation in API Testing
File Upload
JWT Authentication
Modifying AUT based on Testing requirement and vice versa
Framework development
Simple refactoring of code
Understanding Dependency Injection
Creating a framework based on Design patterns in C#
Building with Builder patterns
Writing code with Fluent codes
GraphQL Testing
Understanding GraphQL and testing them
Working with GraphQL.Client
Writing DI code with GraphQL Client
Integration Testing of Application with RestSharp
Specflow integration for BDD support
Contract API testing
Test Reporting with Extent Reporting
CI/CD with GitHub Actions to run Application Under Test and RestSharp test together
Service virtualization testing with Mountebank
Understanding how to perform testing with snapshooter.
With all the above, you will also learn the complete best coding practice done in the industry for performing API testing in .NET and you can right away take the code and implement the same at your work .