Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit Tests for ApiToolkitClientFactory Implementation and Interface Definition for IApiToolkitClientFactory #34

Merged
merged 2 commits into from
Aug 11, 2024

Conversation

shepherrrd
Copy link
Contributor

Closes #33

How to test

Prerequisites:
Ensure NUnit and Moq are Installed: Ensure that you have both NUnit and Moq installed in your test project.
Install-Package Moq
Install-Package NUnit3TestAdapter
Install-Package NUnit

Steps to Test:
Build the Project:

Before running the tests, ensure that your project builds successfully without errors.
Open Test Explorer:

In Visual Studio, navigate to Test > Test Explorer. This will open the Test Explorer window where all test cases from your solution will be listed.
Run Tests:

In the Test Explorer, you should see your test class ApiToolkitClientFactoryTests listed with the individual test methods.
Select the tests you want to run, or click Run All to execute all tests.
View Test Results:

After running the tests, check the Test Explorer for the results.
Passed tests will be marked with a green checkmark, while failed tests will be marked with a red cross. Any test failures will be accompanied by error messages or stack traces to help diagnose issues.

To Test after building you can run dotnet test

Checklist

  • [ X] Make sure you have described your changes and added all relevant screenshots or data.
  • [ X] Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests).
  • [X ] Make sure to add/update documentation regarding your changes (or request one from the team).
  • [ X] You are NOT deprecating/removing a feature.

- Added IApiToolkitClientFactory interface to provide an abstraction for creating HttpClient instances with specific ATOptions.
- Implemented ApiToolkitClientFactory class, which leverages HttpClientFactory for centralized management of HttpClient instances.
- Added IApiToolkitClientFactory interface to provide an abstraction for creating HttpClient instances with specific ATOptions.
- Implemented ApiToolkitClientFactory class, which leverages HttpClientFactory for centralized management of HttpClient instances.
-Added tests For The IApiToolKitCLientFactory
@dawkaka
Copy link
Contributor

dawkaka commented Aug 10, 2024

@shepherrrd thanks for the PR, I'll take a look and merge as soon as possible.

@dawkaka dawkaka merged commit c5c51bb into apitoolkit:main Aug 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need for a HttpCLient factory
2 participants