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

feat: allow using mockaco on aspnet core apps #89

Merged
merged 1 commit into from
Jun 19, 2022
Merged

feat: allow using mockaco on aspnet core apps #89

merged 1 commit into from
Jun 19, 2022

Conversation

gomete
Copy link
Contributor

@gomete gomete commented Mar 17, 2022

Closes #88

Hi @natenho!

These are the changes that I did to use Mockaco in an ASP.NET Core app:

  • We have created a new package Mockaco.AspNetCore with the main logic, extracting the dependency injection and configuration of endpoints.
  • We have added a new way of changing the configuration that fits better with an ASP.NET Core app but maintaining the previous way of configuring it.
  • We have migrated it to .NET 6 as it is LTS.
  • We have moved the VerifyController to use .MapGet to avoid the conditional MapWhen and avoid making it public, so it is not part of the API of the package.
  • We have added the package Microsoft.CodeAnalysis.PublicApiAnalyzers so it is easy to identify which parts of the package are public and to detect breaking changes.
  • We have made internal all the classes that potentially can be internal. The rest of them are public because of Microsoft.CodeAnalysis.CSharp.Scripting.
  • It is compatible with the current standalone Mockaco. We have added some Postman tests to ensure that at least the examples are still working as expected. The Postman tests test/_postman/Mockaco.postman_collection.json and the script checkBuild.ps1 can be removed once you tested the change. We only used them to ensure that the build, the unit tests and the Docker build will work.
  • We have tested adding a controller and an additional MapGet to the existing ASP.NET Core using Mockaco to check that it is using the controller/MapGet instead of using Mockaco. In case there is no match in the existing controllers, it is handled by Mockaco.

@natenho
Copy link
Owner

natenho commented Mar 20, 2022

Well that is a big PR!! It's indeed an awesome feature!
Thank you for your time, I'm glad that you are interested to contribute to the project! I'll be reviewing everything here soon ;-)

@natenho natenho added the enhancement New feature or request label Mar 20, 2022
@gomete
Copy link
Contributor Author

gomete commented May 6, 2022

Hi @natenho, did you have the chance to review this?

@natenho
Copy link
Owner

natenho commented May 6, 2022

Hi @gomete, I apologize the delay. A few days ago I had to fix a bug and I was working on integrating this PR #87, where I noticed some points that needs some improvement before merging. My plan is to merge #87 and your PRs would be the next ones. I would appreciate if you could integrate the current master branch into your code until there.

Anyway, I did not forget your PRs, hang tight! ;)

@gomete
Copy link
Contributor Author

gomete commented May 9, 2022

Hi @natenho, thanks for the quick response! I will solve the conflicts this afternoon.

@natenho natenho changed the base branch from master to feature/88-asp-net-core June 19, 2022 20:02
@natenho natenho merged commit 6b42a40 into natenho:feature/88-asp-net-core Jun 19, 2022
@natenho natenho mentioned this pull request Jun 19, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Mockaco in an ASP.NET Core app
2 participants